ZZJ
2022-07-15 a3f357e8a60443b74b64c7479113c68eb35ce1f5
src/pages/settings/views/clusterManagement.vue
@@ -2,7 +2,7 @@
  <div class="all">
    <!--  -->
    <div class="cluster-guanli" v-if="showCurCluster && isHasColony">
      <cloud-node :nodes="innerNodes"></cloud-node>
      <!-- <cloud-node :nodes="innerNodes"></cloud-node> -->
      <net-node :innerNodes="innerNodes"></net-node>
      <div class="cls-bar">视频分析集群管理</div>
@@ -205,6 +205,18 @@
              </el-input>
            </el-form-item>
          </el-form>
          <div class="clu-list">
            <!-- :class="pickedNodeI == index ? 'clu-item-active' : ''" -->
            <div
              class="clu-item"
              v-for="(item, index) in members"
              :key="index"
              @click="pickNode(index)"
            >
              <i class="iconfont">&#xe727;</i>
              {{ item.Address }}
            </div>
          </div>
          <div class="btns">
            <div class="ok" @click="join('joinForm')">加入集群</div>
          </div>
@@ -226,7 +238,7 @@
  updateClusterName,
  joinCluster,
} from "@/api/clusterManage";
import cloudNode from "../components/CloudNode";
// import cloudNode from "../components/CloudNode";
import NetNode from "../components/NetNode";
import ipInput from "../components/IPInput";
import { isIPv4 } from "@/scripts/validate";
@@ -247,7 +259,7 @@
    };
    const checkID = (rule, value, callback) => {
      if (!value) {
        return callback(new Error("密码不能为空"));
        return callback(new Error("ID不能为空"));
      }
    };
    return {
@@ -302,7 +314,7 @@
    };
  },
  components: {
    cloudNode,
    // cloudNode,
    NetNode,
    ipInput,
  },
@@ -412,12 +424,9 @@
      });
    },
    join(formName) {
      debugger;
      let _this = this;
      this.$refs[formName].validate((valid) => {
        debugger;
        if (valid) {
          debugger;
          _this.joinLoading = true;
          let data = {
            clusterId: _this.joinForm.clusterid,
@@ -533,6 +542,8 @@
    },
    exitCluster() {
      const h = this.$createElement;
      let res = {};
      this.$msgbox({
        title: "",
        message: h(
@@ -557,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) => {
@@ -681,7 +702,7 @@
}
.cluster-guanli {
  margin: 0 auto;
  width: 760px;
  // width: 760px;
  padding: 0 10px;
  .btns {
    margin-top: 30px !important;
@@ -894,7 +915,7 @@
      left: 20px;
    }
    .el-form-item {
      margin-bottom: 10px;
      margin-bottom: 16px;
      .el-input__inner {
        background-color: #ffffff;
        border: 2px solid transparent;