| | |
| | | |
| | | <div class="btns"> |
| | | <div class="cancel button" @click="close()">取消</div> |
| | | <div class="submit button" @click="close()">退出集群</div> |
| | | <div class="submit button" @click="leave()">退出集群</div> |
| | | </div> |
| | | |
| | | <div class="close iconfont" @click="close()"></div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { findCluster, leave } from "@/api/clusterManage"; |
| | | export default { |
| | | props: { |
| | | equipment: {}, |
| | | }, |
| | | created() { |
| | | this.getCluster(); |
| | | }, |
| | | data() { |
| | | return { |
| | | formData: { |
| | | name: "189集群", |
| | | id: "5ee1dfa8-e3fb-4d62-8692-388d7632859b", |
| | | password: "123456", |
| | | ip: "192.168.20.117", |
| | | name: "", |
| | | id: "", |
| | | password: "", |
| | | ip: "", |
| | | }, |
| | | }; |
| | | }, |
| | |
| | | close() { |
| | | this.$emit("close"); |
| | | }, |
| | | async getCluster() { |
| | | let res = await findCluster({ |
| | | nodeId: this.equipment.devId, |
| | | }); |
| | | if (res && res.success) { |
| | | if (res.data && res.data.clusterId) { |
| | | this.formData.name = res.data.clusterName; |
| | | this.formData.id = res.data.clusterId; |
| | | this.formData.password = "******"; |
| | | this.formData.ip = res.data.virtualIp; |
| | | } |
| | | } |
| | | }, |
| | | async leave() { |
| | | const res = await leave({ |
| | | nodeId: this.equipment.devId, |
| | | }); |
| | | if (res && res.success) { |
| | | this.$notify({ |
| | | message: "操作成功", |
| | | type: "success", |
| | | }); |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |