// 节点IP地址管理(标签形式) Vue.component("node-ip-addresses-box", { props: ["v-ip-addresses", "role", "v-node-id"], data: function () { let nodeId = this.vNodeId if (nodeId == null) { nodeId = 0 } return { ipAddresses: (this.vIpAddresses == null) ? [] : this.vIpAddresses, supportThresholds: this.role != "ns", nodeId: nodeId } }, methods: { // 添加IP地址 addIPAddress: function () { window.UPDATING_NODE_IP_ADDRESS = null let that = this; teaweb.popup("/nodes/ipAddresses/createPopup?nodeId=" + this.nodeId + "&supportThresholds=" + (this.supportThresholds ? 1 : 0), { callback: function (resp) { that.ipAddresses.push(resp.data.ipAddress); }, height: "24em", width: "44em" }) }, // 修改地址 updateIPAddress: function (index, address) { window.UPDATING_NODE_IP_ADDRESS = teaweb.clone(address) let that = this; teaweb.popup("/nodes/ipAddresses/updatePopup?nodeId=" + this.nodeId + "&supportThresholds=" + (this.supportThresholds ? 1 : 0), { callback: function (resp) { Vue.set(that.ipAddresses, index, resp.data.ipAddress); }, height: "24em", width: "44em" }) }, // 删除IP地址 removeIPAddress: function (index) { this.ipAddresses.$remove(index); }, // 判断是否为IPv6 isIPv6: function (ip) { return ip.indexOf(":") > -1 } }, template: `
[IPv6] {{address.ip}} ({{address.name}},不可访问 (不可访问) [off] [down] [{{address.thresholds.length}}个阈值]     专属集群:[{{cluster.name}}]  
` })