| | |
| | | clusterid: [{ validator: checkID, trigger: "blur" }],
|
| | | clusterip: [{ validator: isIPv4, trigger: "blur" }],
|
| | | clusterpwd: [{ validator: checkPwd, required: true, trigger: "blur" }]
|
| | | }
|
| | | },
|
| | | quitInput: ""
|
| | | }
|
| | | },
|
| | | components: {
|
| | |
| | | },
|
| | | mounted() {
|
| | | this.findCluster()
|
| | | this.intervalTimer = setInterval(() => {
|
| | | this.findCluster()
|
| | | }, 30000)
|
| | | // this.intervalTimer = setInterval(() => {
|
| | | // this.findCluster()
|
| | | // }, 30000)
|
| | | },
|
| | | beforeDestroy() {
|
| | | clearInterval(this.intervalTimer)
|
| | |
| | | exitCluster() {
|
| | | const h = this.$createElement
|
| | | let res = {}
|
| | |
|
| | | this.quitInput = ""
|
| | | this.$msgbox({
|
| | | title: "",
|
| | | message: h(
|
| | |
| | | [
|
| | | 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: "确定",
|
| | |
| | | // 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 = ""
|
| | |
| | | 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 = ""
|