From a3f357e8a60443b74b64c7479113c68eb35ce1f5 Mon Sep 17 00:00:00 2001 From: ZZJ <10913410+zzj2100@user.noreply.gitee.com> Date: 星期五, 15 七月 2022 19:44:57 +0800 Subject: [PATCH] 控制轮询 --- src/pages/settings/views/clusterManagement.vue | 42 +++++++++++++++++++++++++++--------------- 1 files changed, 27 insertions(+), 15 deletions(-) diff --git a/src/pages/settings/views/clusterManagement.vue b/src/pages/settings/views/clusterManagement.vue index 9db717a..a903df7 100644 --- a/src/pages/settings/views/clusterManagement.vue +++ b/src/pages/settings/views/clusterManagement.vue @@ -259,7 +259,7 @@ }; const checkID = (rule, value, callback) => { if (!value) { - return callback(new Error("瀵嗙爜涓嶈兘涓虹┖")); + return callback(new Error("ID涓嶈兘涓虹┖")); } }; return { @@ -542,6 +542,8 @@ }, exitCluster() { const h = this.$createElement; + let res = {}; + this.$msgbox({ title: "", message: h( @@ -566,19 +568,29 @@ // this.showCurCluster = false; // } async () => { - let res = await leave(); - this.$notify({ - title: res.success ? "鎴愬姛" : "澶辫触", - message: res.msg, - type: res.success ? "success" : "error", - }); - if (res && res.success) { - clearInterval(this.intervalTimer); - this.showCurCluster = false; - this.ruleForm.virtualIp = ""; - this.ruleForm.clustername = ""; - this.ruleForm.clusterpwd = ""; - this.clusterid = ""; + try { + res = await leave(); + if (res && res.success) { + clearInterval(this.intervalTimer); + this.showCurCluster = false; + this.ruleForm.virtualIp = ""; + this.ruleForm.clustername = ""; + this.ruleForm.clusterpwd = ""; + this.clusterid = ""; + } + + this.$notify({ + title: res.success ? "鎴愬姛" : "澶辫触", + message: res.msg, + type: res.success ? "success" : "error", + }); + this.findCluster(); + } catch (err) { + console.log(err); + this.$notify.error({ + title: "澶辫触", + message: err.msg, + }); } }, (err) => { @@ -690,7 +702,7 @@ } .cluster-guanli { margin: 0 auto; - width: 760px; + // width: 760px; padding: 0 10px; .btns { margin-top: 30px !important; -- Gitblit v1.8.0