阶段性提交

This commit is contained in:
刘祥超
2021-06-27 21:59:06 +08:00
parent bd34a9bd37
commit 963be2bc63
42 changed files with 956 additions and 139 deletions

View File

@@ -6,7 +6,7 @@
<form method="post" class="ui form" v-if="!isRequesting">
<p>成功节点:<span class="green">{{countSuccess}}</span> &nbsp; 失败节点:<span class="red">{{countFail}}</span></p>
<table class="ui table selectable celled">
<table class="ui table selectable celled" v-if="results.length > 0">
<thead>
<tr>
<th>节点</th>

View File

@@ -0,0 +1,38 @@
{$layout "layout_popup"}
<h3>添加指标</h3>
<p class="comment" v-if="items.length == 0">暂时还没有指标。</p>
<table class="ui table celled selectable" v-if="items.length > 0">
<thead>
<tr>
<th>指标名称</th>
<th>统计对象</th>
<th>统计周期</th>
<th class="three wide">统计数值</th>
<th class="two wide">状态</th>
<th class="two op">操作</th>
</tr>
</thead>
<tr v-for="item in items">
<td>{{item.name}}</td>
<td>
<span v-if="item.keys != null" v-for="key in item.keys" class="ui label basic small">{{key}}</span>
</td>
<td>
{{item.period}} {{item.periodUnit}}
</td>
<td>
<span class="ui label small basic">{{item.value}}</span>
</td>
<td>
<label-on :v-is-on="item.isOn"></label-on>
</td>
<td>
<a href="" v-if="!item.isChecked">添加</a>
<a href="" v-if="item.isChecked"><span class="grey">已添加</span></a>
</td>
</tr>
</table>
<div class="page" v-html="page"></div>

View File

@@ -0,0 +1,47 @@
{$layout}
{$template "/left_menu"}
<div class="right-box">
<first-menu>
<menu-item :href="'/clusters/cluster/settings/metrics?category=http&clusterId=' + clusterId" :active="category == 'http'">HTTP</menu-item>
<menu-item :href="'/clusters/cluster/settings/metrics?category=tcp&clusterId=' + clusterId" :active="category == 'tcp'">TCP</menu-item>
<menu-item :href="'/clusters/cluster/settings/metrics?category=udp&clusterId=' + clusterId" :active="category == 'udp'">UDP</menu-item>
<span class="item disabled">|</span>
<menu-item @click.prevent="createItem">[添加指标]</menu-item>
<span class="item disabled">|</span>
<span class="item"><tip-icon content="在这里设置的指标,会自动应用到部署在当前集群上的所有服务上。"></tip-icon></span>
</first-menu>
<p class="comment" v-if="items.length == 0">暂时还没有设置指标。</p>
<table class="ui table celled selectable" v-if="items.length > 0">
<thead>
<tr>
<th>指标名称</th>
<th>统计对象</th>
<th>统计周期</th>
<th class="three wide">统计数值</th>
<th class="two wide">状态</th>
<th class="two op">操作</th>
</tr>
</thead>
<tr v-for="item in items">
<td>{{item.name}}</td>
<td>
<span v-if="item.keys != null" v-for="key in item.keys" class="ui label basic small">{{key}}</span>
</td>
<td>
{{item.period}} {{item.periodUnit}}
</td>
<td>
<span class="ui label small basic">{{item.value}}</span>
</td>
<td>
<label-on :v-is-on="item.isOn"></label-on>
</td>
<td>
<a href="" @click.prevent="deleteItem(item.id)">删除</a>
</td>
</tr>
</table>
</div>

View File

@@ -0,0 +1,30 @@
Tea.context(function () {
this.createItem = function () {
teaweb.popup(Tea.url(".createPopup", {
clusterId: this.clusterId
}), {
callback: function () {
teaweb.success("保存成功", function () {
teaweb.reload()
})
},
width: "50em",
height: "25em"
})
}
this.deleteItem = function (itemId) {
let that = this
teaweb.confirm("确定要删除这个指标吗?", function () {
that.$post(".delete")
.params({
itemId: itemId
})
.success(function () {
teaweb.success("删除成功", function () {
teaweb.reload()
})
})
})
}
})

View File

@@ -12,7 +12,7 @@
<td class="title">是否启用TOA</td>
<td>
<checkbox name="isOn" v-model="toa.isOn"></checkbox>
<p class="comment">在启用之前,请确保当前集群下所有节点服务器已经安装TOA模块和libnetfilter_queue并启用了IPTables。</p>
<p class="comment">在启用之前请确保当前集群下所有节点服务器已经安装libnetfilter_queue并启用了IPTables。</p>
</td>
</tr>
<tbody v-show="toa.isOn">