mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-07 15:20:25 +08:00
创建服务的时候默认增加http和https端口绑定
This commit is contained in:
@@ -24,6 +24,11 @@ Vue.component("network-addresses-box", {
|
|||||||
watch: {
|
watch: {
|
||||||
"vServerType": function () {
|
"vServerType": function () {
|
||||||
this.addresses = []
|
this.addresses = []
|
||||||
|
},
|
||||||
|
"vAddresses": function () {
|
||||||
|
if (this.vAddresses != null) {
|
||||||
|
this.addresses = this.vAddresses
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>绑定端口 *</td>
|
<td>绑定端口 *</td>
|
||||||
<td>
|
<td>
|
||||||
<network-addresses-box :v-server-type="serverType"></network-addresses-box>
|
<network-addresses-box :v-server-type="serverType" :v-addresses="defaultAddresses"></network-addresses-box>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +1,49 @@
|
|||||||
Tea.context(function () {
|
Tea.context(function () {
|
||||||
this.serverType = "httpProxy";
|
this.serverType = "httpProxy"
|
||||||
this.tlsProtocolName = ""
|
this.tlsProtocolName = ""
|
||||||
this.origins = [];
|
this.origins = []
|
||||||
|
this.defaultAddresses = []
|
||||||
|
|
||||||
this.success = NotifySuccess("保存成功", "/servers");
|
this.success = NotifySuccess("保存成功", "/servers");
|
||||||
|
|
||||||
this.changeServerType = function () {
|
this.changeServerType = function () {
|
||||||
this.origins = [];
|
this.origins = []
|
||||||
this.tlsProtocolName = "";
|
this.tlsProtocolName = ""
|
||||||
};
|
this.addDefaultAddresses()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化调用
|
||||||
|
this.$delay(function () {
|
||||||
|
this.changeServerType()
|
||||||
|
})
|
||||||
|
|
||||||
this.addOrigin = function () {
|
this.addOrigin = function () {
|
||||||
teaweb.popup("/servers/addOriginPopup?serverType=" + this.serverType, {
|
teaweb.popup("/servers/addOriginPopup?serverType=" + this.serverType, {
|
||||||
callback: function (resp) {
|
callback: function (resp) {
|
||||||
this.origins.push(resp.data.origin);
|
this.origins.push(resp.data.origin);
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
|
|
||||||
this.removeOrigin = function (index) {
|
this.removeOrigin = function (index) {
|
||||||
this.origins.$remove(index);
|
this.origins.$remove(index)
|
||||||
};
|
}
|
||||||
});
|
|
||||||
|
this.addDefaultAddresses = function () {
|
||||||
|
// 默认绑定的端口地址
|
||||||
|
this.defaultAddresses = []
|
||||||
|
if (this.serverType == "httpProxy" || this.serverType == "httpWeb") {
|
||||||
|
this.defaultAddresses.push({
|
||||||
|
"host": "",
|
||||||
|
"portRange": "80",
|
||||||
|
"protocol": "http"
|
||||||
|
})
|
||||||
|
this.defaultAddresses.push({
|
||||||
|
"host": "",
|
||||||
|
"portRange": "443",
|
||||||
|
"protocol": "https"
|
||||||
|
})
|
||||||
|
this.tlsProtocolName = "https"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user