增加API节点安装配置界面

This commit is contained in:
刘祥超
2020-10-11 10:51:13 +08:00
parent 3f793125ab
commit 21c8794f39
34 changed files with 553 additions and 156 deletions

View File

@@ -29,7 +29,9 @@ Vue.component("network-addresses-box", {
methods: {
addAddr: function () {
let that = this
window.UPDATING_ADDR = null
teaweb.popup("/servers/addPortPopup?serverType=" + this.vServerType + "&protocol=" + this.protocol, {
height: "16em",
callback: function (resp) {
var addr = resp.data.address
that.addresses.push(addr)
@@ -47,6 +49,29 @@ Vue.component("network-addresses-box", {
removeAddr: function (index) {
this.addresses.$remove(index);
// 发送事件
this.$emit("change", this.addresses)
},
updateAddr: function (index, addr) {
let that = this
window.UPDATING_ADDR = addr
teaweb.popup("/servers/addPortPopup?serverType=" + this.vServerType + "&protocol=" + this.protocol, {
height: "16em",
callback: function (resp) {
var addr = resp.data.address
Vue.set(that.addresses, index, addr)
if (["https", "https4", "https6"].$contains(addr.protocol)) {
this.tlsProtocolName = "HTTPS"
} else if (["tls", "tls4", "tls6"].$contains(addr.protocol)) {
this.tlsProtocolName = "TLS"
}
// 发送事件
that.$emit("change", that.addresses)
}
})
// 发送事件
this.$emit("change", this.addresses)
}
@@ -56,6 +81,7 @@ Vue.component("network-addresses-box", {
<div v-if="addresses.length > 0">
<div class="ui label small" v-for="(addr, index) in addresses">
{{addr.protocol}}://<span v-if="addr.host.length > 0">{{addr.host}}</span><span v-if="addr.host.length == 0">*</span>:{{addr.portRange}}
<a href="" @click.prevent="updateAddr(index, addr)" title="修改"><i class="icon pencil small"></i></a>
<a href="" @click.prevent="removeAddr(index)" title="删除"><i class="icon remove"></i></a> </div>
<div class="ui divider"></div>
</div>