手动执行健康检查时提示用户当前集群尚未部署网站

This commit is contained in:
GoEdgeLab
2023-05-28 15:06:53 +08:00
parent 218e9be783
commit 3a3ab57953
3 changed files with 42 additions and 25 deletions

View File

@@ -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()
} }

View File

@@ -2,6 +2,10 @@
<h3>健康检查</h3> <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">正在执行中,请等待执行完毕...</span>
<span class="red" v-if="!isRequesting && errorString.length > 0">{{errorString}}</span> <span class="red" v-if="!isRequesting && errorString.length > 0">{{errorString}}</span>
@@ -26,3 +30,4 @@
</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>

View File

@@ -8,7 +8,9 @@ Tea.context(function () {
this.errorString = "" this.errorString = ""
this.$delay(function () { this.$delay(function () {
if (this.hasServers) {
this.run() this.run()
}
}) })
this.run = function () { this.run = function () {