zhangzengfei
2020-10-17 0e0f1959a659562ee4b985ef8f4b62b861e26aa2
完善修改集群名称和ip功能
2个文件已修改
56 ■■■■■ 已修改文件
src/pages/datapush/index/RightEvent.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/settings/components/ClusterManagement.vue 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/datapush/index/RightEvent.vue
@@ -330,7 +330,7 @@
          str += ' = ';
        }
        str += i.rule_value;
        str += i.rule_value === "all*all" ? "全部" : i.rule_value;
        if (str.length > 0) {
          ruleDesc.push(str)
src/pages/settings/components/ClusterManagement.vue
@@ -94,13 +94,18 @@
                style="margin-right:10px;"
                type="primary"
                size="small"
                @click="submitForm('manageForm')"
                @click="updateCluster('manageForm')"
              >保存</el-button>
            </el-form-item>
          </el-form>
        </div>
      </el-col>
      <el-col :span="12" style="height: 100%;" v-if="members.length !== 0 && isSearch" class="node-container">
      <el-col
        :span="12"
        style="height: 100%;"
        v-if="members.length !== 0 && isSearch"
        class="node-container"
      >
        <serfDiagram
          ref="diagram"
          :members="members"
@@ -110,9 +115,13 @@
          class="nodes-svg"
        ></serfDiagram>
      </el-col>
      <el-col :span="12" style="height: 100%;" v-if="innerNodes.length !== 0 && !isSearch" class="node-container">
        <cloud-node :nodes="innerNodes">
        </cloud-node>
      <el-col
        :span="12"
        style="height: 100%;"
        v-if="innerNodes.length !== 0 && !isSearch"
        class="node-container"
      >
        <cloud-node :nodes="innerNodes"></cloud-node>
      </el-col>
    </el-row>
@@ -167,7 +176,6 @@
        </el-tabs>
      </el-col>
    </el-row>
  </div>
</template>
@@ -195,7 +203,7 @@
import cloudNode from "./CloudNode";
import serfDiagram from "@/components/serfDiagram";
import ipInput from "@/components/subComponents/IPInput";
import {isIPv4} from "@/scripts/validate";
import { isIPv4 } from "@/scripts/validate";
export default {
  components: {
    serfDiagram,
@@ -220,7 +228,7 @@
        }
      }, 1000);
    };
    return {
      activeName: "1",
      sActiveName: "s-first",
@@ -332,8 +340,8 @@
        }
      });
    },
    join (formName) {
    join(formName) {
      this.$refs[formName].validate(valid => {
        if (valid) {
          if (Object.keys(this.currentCluster).length === 0) {
@@ -487,8 +495,8 @@
          this.innerNodes = res.data.nodes.map(i => {
            let obj = {};
            obj.device_type = i.device_type;
            obj.workType = i.device_type.substr(2,2);
            obj.hardwareType = i.device_type.substr(4,2);
            obj.workType = i.device_type.substr(2, 2);
            obj.hardwareType = i.device_type.substr(4, 2);
            obj.cluster_id = i.cluster_id;
            obj.clusterName = res.data.clusterName;
            obj.create_time = i.create_time;
@@ -500,7 +508,7 @@
            obj.role = i.role ? i.role : "pc";
            return obj;
          });
          //this.members = this.members.concat(list);
          console.log(this.members)
        } else {
@@ -519,9 +527,19 @@
        console.log(e)
      })
    },
    async updateClusterName() {
    async updateCluster() {
      if (this.ruleForm.clustername === "") {
        this.$message({
          type: "error",
          message: "集群名称不能为空"
        })
        return
      }
      let res = await updateClusterName({
        clusterName: this.mangeForm.colonyName
        clusterName: this.ruleForm.clustername,
        virtualIp: this.ruleForm.virtualIp
      });
      this.$notify({
        title: res.success ? "成功" : "失败",
@@ -706,7 +724,7 @@
        });
      })
    },
    onIpBlur (ip) {
    onIpBlur(ip) {
      //this.vrIpForm.virtual_ip = ip;
      this.ruleForm.virtualIp = ip;
      console.log(this.ruleForm.virtualIp)
@@ -714,7 +732,7 @@
  },
  created () { }
  created() { }
};
</script>
@@ -787,7 +805,7 @@
  height: 30px;
  line-height: 30px;
}
.nodes-svg{
.nodes-svg {
  background-color: rgba(127, 172, 255, 0.459);
}
</style>