// 节点IP地址管理(标签形式) Vue.component("node-ip-addresses-box", { props: ["vIpAddresses"], data: function () { return { ipAddresses: (this.vIpAddresses == null) ? [] : this.vIpAddresses } }, methods: { // 添加IP地址 addIPAddress: function () { window.UPDATING_NODE_IP_ADDRESS = null let that = this; teaweb.popup("/nodes/ipAddresses/createPopup", { callback: function (resp) { that.ipAddresses.push(resp.data.ipAddress); }, height: "24em", width: "44em" }) }, // 修改地址 updateIPAddress: function (index, address) { window.UPDATING_NODE_IP_ADDRESS = address let that = this; teaweb.popup("/nodes/ipAddresses/updatePopup", { 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: `
` })