From 4b43bfb3f6f499f480712dd29bef52275466afd6 Mon Sep 17 00:00:00 2001 From: heyujie <516346543@qq.com> Date: 星期五, 30 七月 2021 22:10:59 +0800 Subject: [PATCH] change all --- src/pages/settings/views/clusterManagement.vue | 58 +++++++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 41 insertions(+), 17 deletions(-) diff --git a/src/pages/settings/views/clusterManagement.vue b/src/pages/settings/views/clusterManagement.vue index 7f85dd0..9910df1 100644 --- a/src/pages/settings/views/clusterManagement.vue +++ b/src/pages/settings/views/clusterManagement.vue @@ -1,6 +1,6 @@ <template> <div class="all"> - <div class="cluster-guanli" v-if="showCurCluster"> + <div class="cluster-guanli" v-if="showCurCluster&& isHasColony"> <cloud-node :nodes="innerNodes"></cloud-node> <div class="bar"> @@ -22,13 +22,13 @@ ></span > <span - class="icon iconfont" + class="icon iconfont" style="font-size:21px;" @click="clearInput(1)" v-show="isFillingName" ></span > - <span - class="icon iconfont" + <span + class="icon iconfont" style="font-size:20px;" @click="updateCluster(1)" v-show="isFillingName" ></span @@ -65,14 +65,14 @@ ></span > <span - class="icon iconfont" + class="icon iconfont" style="font-size:21px;" @click="clearInput(2)" v-show="isFillingIp" ></span > <span class="icon iconfont" - @click="updateCluster(2)" + @click="updateCluster(2)" style="font-size:20px;" v-show="isFillingIp" ></span > @@ -83,7 +83,7 @@ </div> <div class="cluster-content"> - <div class="cluster-center" ref="left" v-if="!showCurCluster"> + <div class="cluster-center" ref="left" v-if="!showCurCluster|| !isHasColony"> <div class="menu-item" :class="activePage == i ? 'menu-item-active' : ''" @@ -94,7 +94,7 @@ {{ item }} </div> </div> - <div class="cluster-right" v-if="!showCurCluster"> + <div class="cluster-right" v-if="!showCurCluster || !isHasColony"> <div class="create-new" v-if="activePage == 0"> <el-form :model="ruleForm" @@ -198,6 +198,7 @@ import { createSerfCluster, randomPwd, + leave, search, getSearchNodes, stopSearching, @@ -284,9 +285,8 @@ }, mounted() { this.findCluster(); - let _this = this; this.intervalTimer = setInterval(() => { - _this.findCluster(); + this.findCluster(); }, 30000); }, beforeDestroy() { @@ -457,12 +457,29 @@ this.ruleForm.clusterpwd = uuid.join(""); }, exitCluster() { - clearInterval(this.intervalTimer); - this.showCurCluster = false; - this.ruleForm.virtualIp = ""; - this.ruleForm.clustername = ""; - this.ruleForm.clusterpwd = ""; - this.clusterid = ""; + this.$confirm("纭畾閫�鍑洪泦缇ゅ悧锛�","鎻愮ず").then(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 = ""; + } + },(err) => { + clearInterval(this.intervalTimer); + this.showCurCluster = false; + this.ruleForm.virtualIp = ""; + this.ruleForm.clustername = ""; + this.ruleForm.clusterpwd = ""; + this.clusterid = ""; + }) }, clearInput(typ) { if (typ == 1) { @@ -571,6 +588,9 @@ padding: 0 20px; justify-content: space-between; align-items: center; + .title{ + font-size: 14px; + } .input-area { display: flex; width: 340px; @@ -578,6 +598,10 @@ line-height: 30px; justify-content: inherit; box-sizing: border-box; + .icon{ + cursor: pointer; + // font-size: 18px; + } } } .exit { @@ -609,7 +633,7 @@ padding: 10px; border-right: 5px solid #f8f8f8; .menu-item { - background-color: #f8f8f8; + background-color: #f8f8f8; cursor: pointer; height: 50px; margin-bottom: 10px; border-radius: 8px; -- Gitblit v1.8.0