Files
EdgeAdmin/web/views/@default/servers/addPortPopup.js

47 lines
927 B
JavaScript
Raw Permalink Normal View History

2020-08-21 12:32:16 +08:00
Tea.context(function () {
this.success = NotifyPopup;
2020-10-11 10:51:13 +08:00
this.isUpdating = false
this.address = ""
this.protocol = this.protocols[0].code
// 初始化
2021-06-28 21:09:22 +08:00
// from 用来标记是否为特殊的节点
if (this.from.length == 0) {
if (this.protocol == "http") {
this.address = "80"
} else if (this.protocol == "https") {
this.address = "443"
}
}
2020-10-11 10:51:13 +08:00
if (window.parent.UPDATING_ADDR != null) {
this.isUpdating = true
let addr = window.parent.UPDATING_ADDR
this.protocol = addr.protocol
if (addr.host.length == 0) {
this.address = addr.portRange
} else {
2021-07-20 10:55:25 +08:00
this.address = addr.host.quoteIP() + ":" + addr.portRange
2020-10-11 10:51:13 +08:00
}
}
this.changeProtocol = function () {
2021-06-28 21:09:22 +08:00
if (this.from.length > 0) {
return
}
switch (this.protocol) {
case "http":
this.address = "80"
break
case "https":
this.address = "443"
2021-06-06 09:22:59 +08:00
break
}
}
this.addPort = function (port) {
this.address = port
}
2020-08-21 12:32:16 +08:00
});