| | |
| | | <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">
|
| | |
| | | ></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
|
| | |
| | | ></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
|
| | | >
|
| | |
| | | </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' : ''"
|
| | |
| | | {{ 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"
|
| | |
| | | import {
|
| | | createSerfCluster,
|
| | | randomPwd,
|
| | | leave,
|
| | | search,
|
| | | getSearchNodes,
|
| | | stopSearching,
|
| | |
| | | },
|
| | | mounted() {
|
| | | this.findCluster();
|
| | | let _this = this;
|
| | | this.intervalTimer = setInterval(() => {
|
| | | _this.findCluster();
|
| | | this.findCluster();
|
| | | }, 30000);
|
| | | },
|
| | | beforeDestroy() {
|
| | |
| | | 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) {
|
| | |
| | | padding: 0 20px;
|
| | | justify-content: space-between;
|
| | | align-items: center;
|
| | | .title{
|
| | | font-size: 14px;
|
| | | }
|
| | | .input-area {
|
| | | display: flex;
|
| | | width: 340px;
|
| | |
| | | line-height: 30px;
|
| | | justify-content: inherit;
|
| | | box-sizing: border-box;
|
| | | .icon{
|
| | | cursor: pointer;
|
| | | // font-size: 18px;
|
| | | }
|
| | | }
|
| | | }
|
| | | .exit {
|
| | |
| | | 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;
|