diff --git a/internal/web/actions/default/clusters/cluster/settings/health/runPopup.go b/internal/web/actions/default/clusters/cluster/settings/health/runPopup.go index 69a19d83..2642e565 100644 --- a/internal/web/actions/default/clusters/cluster/settings/health/runPopup.go +++ b/internal/web/actions/default/clusters/cluster/settings/health/runPopup.go @@ -15,7 +15,17 @@ func (this *RunPopupAction) Init() { 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() } diff --git a/web/views/@default/clusters/cluster/settings/health/runPopup.html b/web/views/@default/clusters/cluster/settings/health/runPopup.html index 969ff768..da4fbac3 100644 --- a/web/views/@default/clusters/cluster/settings/health/runPopup.html +++ b/web/views/@default/clusters/cluster/settings/health/runPopup.html @@ -2,27 +2,32 @@

健康检查

-正在执行中,请等待执行完毕... -{{errorString}} +
+ 当前集群尚未部署网站,无法进行健康检查;请至少部署至少一个网站后再试。 +
+
+ 正在执行中,请等待执行完毕... + {{errorString}} -
-

成功节点:{{countSuccess}}   失败节点:{{countFail}}

- - - - - - - - - - - - - -
节点结果耗时
{{result.node.name}}({{result.nodeAddr}}) - 失败:{{result.error}} - 成功 - {{result.costMs}}ms
- -
\ No newline at end of file +
+

成功节点:{{countSuccess}}   失败节点:{{countFail}}

+ + + + + + + + + + + + + +
节点结果耗时
{{result.node.name}}({{result.nodeAddr}}) + 失败:{{result.error}} + 成功 + {{result.costMs}}ms
+ +
+
\ No newline at end of file diff --git a/web/views/@default/clusters/cluster/settings/health/runPopup.js b/web/views/@default/clusters/cluster/settings/health/runPopup.js index 7e7659fe..76fc5510 100644 --- a/web/views/@default/clusters/cluster/settings/health/runPopup.js +++ b/web/views/@default/clusters/cluster/settings/health/runPopup.js @@ -8,7 +8,9 @@ Tea.context(function () { this.errorString = "" this.$delay(function () { - this.run() + if (this.hasServers) { + this.run() + } }) this.run = function () {