From c69082e60f9b27dfd8c6cfa64af0b36ede1fade4 Mon Sep 17 00:00:00 2001
From: heyujie <516346543@qq.com>
Date: 星期五, 05 十一月 2021 14:13:39 +0800
Subject: [PATCH] merge
---
src/pages/settings/components/ClusterManagement.vue | 129 ++++++++++++++++++++++--------------------
1 files changed, 68 insertions(+), 61 deletions(-)
diff --git a/src/pages/settings/components/ClusterManagement.vue b/src/pages/settings/components/ClusterManagement.vue
index 6cb3bec..bedd193 100644
--- a/src/pages/settings/components/ClusterManagement.vue
+++ b/src/pages/settings/components/ClusterManagement.vue
@@ -222,7 +222,7 @@
ipInput,
cloudNode
},
- data () {
+ data() {
const checkPwd = (rule, value, callback) => {
if (!value) {
return callback(new Error("瀵嗙爜涓嶈兘涓虹┖"));
@@ -306,7 +306,7 @@
showJoinConfirm: false
};
},
- mounted () {
+ mounted() {
this.findCluster();
let _this = this;
this.intervalTimer = setInterval(() => {
@@ -314,20 +314,20 @@
}, 30000);
//this.getEsClusterNodes();
},
- beforeDestroy () {
+ beforeDestroy() {
clearInterval(this.intervalTimer);
},
methods: {
- checkPsd (psd) {
+ checkPsd(psd) {
return psd.trim().length === 6
},
- cleanValue () {
- this.members = [];
- },
- sHandleClick (tab, event) {
- console.log(tab, event);
- },
- submitForm (formName) {
+ // cleanValue() {
+ // this.members = [];
+ // },
+ // sHandleClick(tab, event) {
+ // console.log(tab, event);
+ // },
+ submitForm(formName) {
this.$refs[formName].validate(valid => {
if (valid) {
//alert("submit!");
@@ -347,27 +347,27 @@
});
},
- 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) {
+ join(formName) {
let _this = this;
this.$refs[formName].validate(valid => {
if (valid) {
@@ -403,7 +403,7 @@
}
});
},
- async createCluster (json) {
+ async createCluster(json) {
let res = await createSerfCluster(json);
console.log(res, "鍒涘缓闆嗙兢");
this.$notify({
@@ -412,13 +412,13 @@
type: res.success ? "success" : "error"
});
},
- async randomPwd () {
+ async randomPwd() {
let res = await randomPwd();
if (res && res.success) {
this.ruleForm.clusterpwd = res.data;
}
},
- async searchColony () {
+ async searchColony() {
this.isSearch = true;
this.$refs["joinForm"].clearValidate();
this.$refs["joinForm"].validateField('clusterpwd');
@@ -448,7 +448,7 @@
}
//});
},
- async search (json) {
+ async search(json) {
let res = await search(json);
if (res && res.success) {
console.log(res, "鎼滅储闆嗙兢");
@@ -461,7 +461,7 @@
}, 10 * 1000);
},
//鎼滅储闆嗙兢
- async getSearchNodes () {
+ async getSearchNodes() {
let res = await getSearchNodes();
if (res && res.success) {
let list = res.data.map(i => {
@@ -485,12 +485,12 @@
});
}
},
- setSchedule () {
+ setSchedule() {
this.scheduleId = window.setInterval(() => {
this.getSearchNodes();
}, 1000);
},
- async stopSearch () {
+ async stopSearch() {
if (!this.loading) {
return true;
}
@@ -515,7 +515,7 @@
// },2000)
})
},
- async findCluster () {
+ async findCluster() {
let res = await findCluster();
if (res && res.success) {
if (res.data && res.data.clusterId) {
@@ -552,17 +552,17 @@
}
}
},
- 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 () {
+ // 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({
type: "error",
@@ -582,7 +582,7 @@
type: res.success ? "success" : "error"
});
},
- async joinCluster (json) {
+ async joinCluster(json) {
let res = await joinCluster(json);
if (res.success) {
this.members = []
@@ -593,7 +593,7 @@
type: res.success ? "success" : "error"
});
},
- leave () {
+ leave() {
this.$confirm(`纭畾閫�鍑洪泦缇ゅ悧?`, {
center: true,
cancelButtonClass: "comfirm-class-cancle",
@@ -614,11 +614,19 @@
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) {
- console.log('join',node)
+ joinNode(event, node) {
+ console.log('join', node)
let _this = this;
this.currentCluster.cluster_id = node.cluster_id;
if (this.activeName === "3") {
@@ -627,7 +635,6 @@
return;
}
if (this.activeName === "2") {
- debugger
if (_this.showJoinConfirm) return;
this.$confirm("鏄惁瑕佸姞鍏ヨ妭鐐� " + node.nodeName + "?", "鍔犲叆闆嗙兢", {
@@ -684,7 +691,7 @@
// });
}
},
- generatePassword () {
+ generatePassword() {
var chars =
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var uuid = [];
@@ -696,7 +703,7 @@
this.ruleForm.clusterpwd = uuid.join("");
},
- async getEsClusterNodes () {
+ async getEsClusterNodes() {
let rsp = await getDevInfo();
let hostIpAddr = "";
if (rsp && rsp.success) {
@@ -722,7 +729,7 @@
}
}
},
- createEsCluster () {
+ createEsCluster() {
createESNode().then(rsp => {
if (rsp && rsp.success) {
this.$message({
@@ -747,7 +754,7 @@
});
})
},
- joinESCluster () {
+ joinESCluster() {
if (!this.esNodeIp.length) {
this.$message({
type: "error",
@@ -781,7 +788,7 @@
});
})
},
- onIpBlur (ip) {
+ onIpBlur(ip) {
//this.vrIpForm.virtual_ip = ip;
this.ruleForm.virtualIp = ip;
console.log(this.ruleForm.virtualIp)
@@ -789,7 +796,7 @@
},
- created () { }
+ created() { }
};
</script>
--
Gitblit v1.8.0