| | |
| | | class="join-form"
|
| | | v-loading="joinLoading"
|
| | | >
|
| | | <!-- <el-form-item prop="clusterid">
|
| | | <el-form-item prop="clusterid">
|
| | | <div class="p-title">集群ID</div>
|
| | | <el-input v-model="joinForm.clusterid" size="small"></el-input>
|
| | | </el-form-item>
|
| | |
| | | size="small"
|
| | | autocomplete="new-password"
|
| | | ></el-input>
|
| | | </el-form-item> -->
|
| | | </el-form-item>
|
| | | <el-form-item prop="clusterpwd">
|
| | | <div class="p-title">集群密码</div>
|
| | | <el-input
|
| | |
| | | {{ item.Address }}
|
| | | </div>
|
| | | </div>
|
| | | <!-- <div class="btns">
|
| | | <div class="btns">
|
| | | <div class="ok" @click="join('joinForm')">加入集群</div>
|
| | | </div> -->
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | |
| | | export default {
|
| | | data() {
|
| | | const checkPwd = (rule, value, callback) => {
|
| | | if (value=="") {
|
| | | if (value == "") {
|
| | | return callback(new Error("密码不能为空"));
|
| | | }
|
| | | // setTimeout(() => {
|
| | | if (value.length != 6) {
|
| | | callback(new Error("密码应为6位!"));
|
| | | } else {
|
| | | callback();
|
| | | }
|
| | | if (value.length != 6) {
|
| | | callback(new Error("密码应为6位!"));
|
| | | } else {
|
| | | callback();
|
| | | }
|
| | | // }, 1000);
|
| | | };
|
| | | const checkID = (rule, value, callback) => {
|
| | | if (!value) {
|
| | | return callback(new Error("密码不能为空"));
|
| | | return callback(new Error("ID不能为空"));
|
| | | }
|
| | | };
|
| | | return {
|
| | |
| | | clustername: [
|
| | | { required: true, message: "请输入集群名称", trigger: "blur" },
|
| | | ],
|
| | | clusterpwd: [{ validator: checkPwd, required: true,trigger: "blur" }],
|
| | | clusterpwd: [{ validator: checkPwd, required: true, trigger: "blur" }],
|
| | | virtualIp: [{ required: true, validator: isIPv4, trigger: "change" }],
|
| | | },
|
| | | joinExistRules: {
|
| | | clusterid: [{ validator: checkID, trigger: "blur" }],
|
| | | clusterip: [{ validator: isIPv4, trigger: "blur" }],
|
| | | clusterpwd: [{ validator: checkPwd, required: true,trigger: "blur" }],
|
| | | clusterpwd: [{ validator: checkPwd, required: true, trigger: "blur" }],
|
| | | },
|
| | | };
|
| | | },
|
| | |
| | | },
|
| | | exitCluster() {
|
| | | const h = this.$createElement;
|
| | | let res = {};
|
| | |
|
| | | this.$msgbox({
|
| | | title: "",
|
| | | message: h(
|
| | |
| | | cancelButtonText: "取消",
|
| | | customClass: "del-account-message-box",
|
| | | }).then(
|
| | | () => {
|
| | | this.showCurCluster = false;
|
| | | }
|
| | | // 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 = "";
|
| | | // }
|
| | | async () => {
|
| | | try {
|
| | | res = await leave();
|
| | | if (res && res.success) {
|
| | | clearInterval(this.intervalTimer);
|
| | | this.showCurCluster = false;
|
| | | this.ruleForm.virtualIp = "";
|
| | | this.ruleForm.clustername = "";
|
| | | this.ruleForm.clusterpwd = "";
|
| | | this.clusterid = "";
|
| | | }
|
| | |
|
| | | this.$notify({
|
| | | title: res.success ? "成功" : "失败",
|
| | | message: res.msg,
|
| | | type: res.success ? "success" : "error",
|
| | | });
|
| | | this.findCluster();
|
| | | } catch (err) {
|
| | | console.log(err);
|
| | | this.$notify.error({
|
| | | title: "失败",
|
| | | message: err.msg,
|
| | | });
|
| | | }
|
| | | },
|
| | | (err) => {
|
| | | clearInterval(this.intervalTimer);
|
| | | this.showCurCluster = false;
|
| | | this.ruleForm.virtualIp = "";
|
| | | this.ruleForm.clustername = "";
|
| | | this.ruleForm.clusterpwd = "";
|
| | | this.clusterid = "";
|
| | | }
|
| | | );
|
| | | },
|
| | | clearInput(typ) {
|
| | |
| | | }
|
| | | .cluster-guanli {
|
| | | margin: 0 auto;
|
| | | width: 760px;
|
| | | // width: 760px;
|
| | | padding: 0 10px;
|
| | | .btns {
|
| | | margin-top: 30px !important;
|
| | |
| | | left: 20px;
|
| | | }
|
| | | .el-form-item {
|
| | | margin-bottom: 10px;
|
| | | margin-bottom: 16px;
|
| | | .el-input__inner {
|
| | | background-color: #ffffff;
|
| | | border: 2px solid transparent;
|