zhangzengfei
2021-06-11 fa7044f3ccc9a91bc2bc117d1a06f650d86554f2
src/pages/settings/components/ClusterManagement.vue
@@ -321,12 +321,12 @@
    checkPsd(psd) {
      return psd.trim().length === 6
    },
    cleanValue() {
      this.members = [];
    },
    sHandleClick(tab, event) {
      console.log(tab, event);
    },
    // cleanValue() {
    //   this.members = [];
    // },
    // sHandleClick(tab, event) {
    //   console.log(tab, event);
    // },
    submitForm(formName) {
      this.$refs[formName].validate(valid => {
        if (valid) {
@@ -347,25 +347,25 @@
      });
    },
    saveForm(formName) {
      this.$refs[formName].validate(valid => {
        if (valid) {
          alert("submit!");
          let json = {
            enable: this.vrIpForm.enable,
            serve_port: this.vrIpForm.serve_port,
            virtual_ip: this.vrIpForm.virtual_ip,
    // saveForm(formName) {
    //   this.$refs[formName].validate(valid => {
    //     if (valid) {
    //       alert("submit!");
    //       let json = {
    //         enable: this.vrIpForm.enable,
    //         serve_port: this.vrIpForm.serve_port,
    //         virtual_ip: this.vrIpForm.virtual_ip,
          };
          setVrrp(json).then(() => {
            this.getVrrpInfo();
          });
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
    //       };
    //       setVrrp(json).then(() => {
    //         this.getVrrpInfo();
    //       });
    //     } else {
    //       console.log("error submit!!");
    //       return false;
    //     }
    //   });
    // },
    join(formName) {
      let _this = this;
@@ -552,16 +552,16 @@
        }
      }
    },
    getVrrpInfo() {
      getVrrp().then(res => {
        if (res.success) {
          this.vrIpForm.virtual_ip = res.data.virtual_ip;
          this.vrIpForm.enable = res.data.enable;
        }
      }).catch(e => {
        console.log(e)
      })
    },
    // getVrrpInfo() {
    //   getVrrp().then(res => {
    //     if (res.success) {
    //       this.vrIpForm.virtual_ip = res.data.virtual_ip;
    //       this.vrIpForm.enable = res.data.enable;
    //     }
    //   }).catch(e => {
    //     console.log(e)
    //   })
    // },
    async updateCluster() {
      if (this.ruleForm.clustername === "") {
        this.$message({
@@ -614,7 +614,15 @@
          this.members = [];
          this.innerNodes = [];
        }
      }).catch(() => { });
      }).catch(() => {
         this.ruleForm.clustername = "";
          this.ruleForm.clusterpwd = ""
          this.clusterid = "";
          this.isHasColony = false;
          this.activeName = "1";
          this.members = [];
          this.innerNodes = [];
       });
    },
    joinNode(event, node) {