mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 05:00:25 +08:00 
			
		
		
		
	手动执行健康检查时提示用户当前集群尚未部署网站
This commit is contained in:
		@@ -15,7 +15,17 @@ func (this *RunPopupAction) Init() {
 | 
				
			|||||||
	this.Nav("", "", "")
 | 
						this.Nav("", "", "")
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (this *RunPopupAction) RunGet(params struct{}) {
 | 
					func (this *RunPopupAction) RunGet(params struct {
 | 
				
			||||||
 | 
						ClusterId int64
 | 
				
			||||||
 | 
					}) {
 | 
				
			||||||
 | 
						// 检查是否已部署服务
 | 
				
			||||||
 | 
						countServersResp, err := this.RPC().ServerRPC().CountAllEnabledServersWithNodeClusterId(this.AdminContext(), &pb.CountAllEnabledServersWithNodeClusterIdRequest{NodeClusterId: params.ClusterId})
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							this.ErrorPage(err)
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						this.Data["hasServers"] = countServersResp.Count > 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	this.Show()
 | 
						this.Show()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,27 +2,32 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
<h3>健康检查</h3>
 | 
					<h3>健康检查</h3>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<span class="red" v-if="isRequesting">正在执行中,请等待执行完毕...</span>
 | 
					<div v-show="!hasServers">
 | 
				
			||||||
<span class="red" v-if="!isRequesting && errorString.length > 0">{{errorString}}</span>
 | 
					    <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">
 | 
					    <form method="post" class="ui form" v-if="!isRequesting && errorString.length == 0">
 | 
				
			||||||
	<p>成功节点:<span class="green">{{countSuccess}}</span>   失败节点:<span class="red">{{countFail}}</span></p>
 | 
					        <p>成功节点:<span class="green">{{countSuccess}}</span>   失败节点:<span class="red">{{countFail}}</span></p>
 | 
				
			||||||
	<table class="ui table selectable celled" v-if="results.length > 0">
 | 
					        <table class="ui table selectable celled" v-if="results.length > 0">
 | 
				
			||||||
		<thead>
 | 
					            <thead>
 | 
				
			||||||
			<tr>
 | 
					                <tr>
 | 
				
			||||||
				<th>节点</th>
 | 
					                    <th>节点</th>
 | 
				
			||||||
				<th>结果</th>
 | 
					                    <th>结果</th>
 | 
				
			||||||
				<th nowrap="">耗时</th>
 | 
					                    <th nowrap="">耗时</th>
 | 
				
			||||||
			</tr>
 | 
					                </tr>
 | 
				
			||||||
		</thead>
 | 
					            </thead>
 | 
				
			||||||
		<tr v-for="result in results">
 | 
					            <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>{{result.node.name}}<span class="small" v-if="result.nodeAddr != null && result.nodeAddr.length > 0">({{result.nodeAddr}})</span></td>
 | 
				
			||||||
			<td>
 | 
					                <td>
 | 
				
			||||||
				<span v-if="!result.isOk" class="red">失败:{{result.error}}</span>
 | 
					                    <span v-if="!result.isOk" class="red">失败:{{result.error}}</span>
 | 
				
			||||||
				<span v-else class="green">成功</span>
 | 
					                    <span v-else class="green">成功</span>
 | 
				
			||||||
			</td>
 | 
					                </td>
 | 
				
			||||||
			<td>{{result.costMs}}ms</td>
 | 
					                <td>{{result.costMs}}ms</td>
 | 
				
			||||||
		</tr>
 | 
					            </tr>
 | 
				
			||||||
	</table>
 | 
					        </table>
 | 
				
			||||||
	<button class="ui button primary" type="button" @click.prevent="success">完成</button>
 | 
					        <button class="ui button primary" type="button" @click.prevent="success">完成</button>
 | 
				
			||||||
</form>
 | 
					    </form>
 | 
				
			||||||
 | 
					</div>
 | 
				
			||||||
@@ -8,7 +8,9 @@ Tea.context(function () {
 | 
				
			|||||||
	this.errorString = ""
 | 
						this.errorString = ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	this.$delay(function () {
 | 
						this.$delay(function () {
 | 
				
			||||||
		this.run()
 | 
							if (this.hasServers) {
 | 
				
			||||||
 | 
								this.run()
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	this.run = function () {
 | 
						this.run = function () {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user