zhangzengfei
2023-10-24 6199a2238efcc2449c79aa228e40cb75c59cf663
集群退出添加密码
1个文件已修改
33 ■■■■ 已修改文件
src/pages/settings/views/clusterManagement.vue 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/settings/views/clusterManagement.vue
@@ -252,7 +252,8 @@
        clusterid: [{ validator: checkID, trigger: "blur" }],
        clusterip: [{ validator: isIPv4, trigger: "blur" }],
        clusterpwd: [{ validator: checkPwd, required: true, trigger: "blur" }]
      }
      },
      quitInput: ""
    }
  },
  components: {
@@ -262,9 +263,9 @@
  },
  mounted() {
    this.findCluster()
    this.intervalTimer = setInterval(() => {
      this.findCluster()
    }, 30000)
    // this.intervalTimer = setInterval(() => {
    //   this.findCluster()
    // }, 30000)
  },
  beforeDestroy() {
    clearInterval(this.intervalTimer)
@@ -481,7 +482,7 @@
    exitCluster() {
      const h = this.$createElement
      let res = {}
      this.quitInput = ""
      this.$msgbox({
        title: "",
        message: h(
@@ -492,9 +493,14 @@
          [
            h("span", { class: "icon iconfont warn-icon" }, "\ue71c"),
            h("span", { class: "warn-title" }, "退出集群"),
            h("span", { class: "warn-dec" }, "确定退出集群吗?")
            h("input", {
              attrs: { placeholder: "请输入集群密码", id: "quit-input", class: "warn-title" },
              value: "",
              on: { input: this.onQuitInputChange }
            })
          ]
        ),
        // showInput: true,
        showCancelButton: true,
        showClose: true,
        confirmButtonText: "确定",
@@ -505,10 +511,10 @@
        //   this.showCurCluster = false;
        // }
        async () => {
          clearInterval(this.intervalTimer)
          try {
            res = await leave()
            res = await leave({ password: this.quitInput })
            if (res && res.success) {
              clearInterval(this.intervalTimer)
              this.showCurCluster = false
              this.ruleForm.virtualIp = ""
              this.ruleForm.clustername = ""
@@ -529,17 +535,12 @@
              message: err.msg
            })
          }
        },
        (err) => {
          clearInterval(this.intervalTimer)
          this.showCurCluster = false
          this.ruleForm.virtualIp = ""
          this.ruleForm.clustername = ""
          this.ruleForm.clusterpwd = ""
          this.clusterid = ""
        }
      )
    },
    onQuitInputChange() {
      this.quitInput = document.getElementById("quit-input").value
    },
    clearInput(typ) {
      if (typ == 1) {
        this.selfForm.clustername = ""