1.4.5.2
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
{$layout}
|
||||
{$template "../menu"}
|
||||
{$template "/left_menu_with_menu"}
|
||||
|
||||
<div class="right-box with-menu">
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="clusterId" :value="clusterId"/>
|
||||
<health-check-config-box :v-health-check-config="healthCheckConfig" :v-check-domain-url="'/clusters/cluster/settings/health/checkDomain?clusterId=' + clusterId" :v-is-plus="teaIsPlus"></health-check-config-box>
|
||||
<submit-btn></submit-btn> <a href="" @click.prevent="run()" v-if="healthCheckConfig != null && healthCheckConfig.isOn">立即检查</a>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,11 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
|
||||
this.run = function () {
|
||||
teaweb.confirm("确定要对当前集群下的所有节点进行健康检查吗?", function () {
|
||||
teaweb.popup("/clusters/cluster/settings/health/runPopup?clusterId=" + this.clusterId, {
|
||||
height: "30em"
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,33 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>健康检查</h3>
|
||||
|
||||
<div v-show="!hasServers">
|
||||
<span class="red">当前集群尚未部署网站,无法进行健康检查;请至少部署至少一个网站后再试。</span>
|
||||
</div>
|
||||
<div v-show="hasServers">
|
||||
<span class="red" v-if="isRequesting">正在执行中,请等待执行完毕...</span>
|
||||
<span class="red" v-if="!isRequesting && errorString.length > 0">{{errorString}}</span>
|
||||
|
||||
<form method="post" class="ui form" v-if="!isRequesting && errorString.length == 0">
|
||||
<p>成功节点:<span class="green">{{countSuccess}}</span> 失败节点:<span class="red">{{countFail}}</span></p>
|
||||
<table class="ui table selectable celled" v-if="results.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>节点</th>
|
||||
<th>结果</th>
|
||||
<th nowrap="">耗时</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="result in results">
|
||||
<td>{{result.node.name}}<span class="small" v-if="result.nodeAddr != null && result.nodeAddr.length > 0">({{result.nodeAddr}})</span></td>
|
||||
<td>
|
||||
<span v-if="!result.isOk" class="red">失败:{{result.error}}</span>
|
||||
<span v-else class="green">成功</span>
|
||||
</td>
|
||||
<td>{{result.costMs}}ms</td>
|
||||
</tr>
|
||||
</table>
|
||||
<button class="ui button primary" type="button" @click.prevent="success">完成</button>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,47 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyPopup
|
||||
|
||||
this.isRequesting = true
|
||||
this.results = []
|
||||
this.countSuccess = 0
|
||||
this.countFail = 0
|
||||
this.errorString = ""
|
||||
|
||||
this.$delay(function () {
|
||||
if (this.hasServers) {
|
||||
this.run()
|
||||
}
|
||||
})
|
||||
|
||||
this.run = function () {
|
||||
this.isRequesting = true
|
||||
this.errorString = ""
|
||||
|
||||
this.$post("$")
|
||||
.params({
|
||||
clusterId: this.clusterId
|
||||
})
|
||||
.timeout(60)
|
||||
.success(function (resp) {
|
||||
this.results = resp.data.results
|
||||
let that = this
|
||||
this.results.forEach(function (v) {
|
||||
v.costMs = Math.ceil(v.costMs)
|
||||
if (isNaN(v.costMs)) {
|
||||
v.costMs = 0
|
||||
}
|
||||
if (v.isOk) {
|
||||
that.countSuccess++
|
||||
} else {
|
||||
that.countFail++
|
||||
}
|
||||
})
|
||||
})
|
||||
.error(function () {
|
||||
this.errorString = "执行健康检查超时,请重试"
|
||||
})
|
||||
.done(function () {
|
||||
this.isRequesting = false
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user