mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-27 13:40:25 +08:00
优化添加端口、添加源站相关交互
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
<tr>
|
||||
<td class="title">绑定端口 *</td>
|
||||
<td>
|
||||
<span class="red" v-if="httpConfig.isOn && httpConfig.addresses == null || httpConfig.addresses.length == 0">还没有添加端口绑定,会导致HTTP服务无法访问。</span>
|
||||
<network-addresses-box :v-server-type="serverType" :v-addresses="httpConfig.addresses" :v-protocol="'http'"></network-addresses-box>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
<tr>
|
||||
<td class="title">绑定端口 *</td>
|
||||
<td>
|
||||
<span class="red" v-if="httpsConfig.isOn && httpsConfig.addresses == null || httpsConfig.addresses.length == 0">还没有添加端口绑定,会导致HTTPS服务无法访问。</span>
|
||||
<network-addresses-box :v-server-type="serverType" :v-addresses="httpsConfig.addresses" :v-protocol="'https'"></network-addresses-box>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<td>源站协议</td>
|
||||
<td>
|
||||
<!-- HTTP -->
|
||||
<select class="ui dropdown auto-width" name="protocol" v-if="serverType == 'httpProxy' || serverType == 'httpWeb'">
|
||||
<select class="ui dropdown auto-width" name="protocol" v-model="protocol" v-if="serverType == 'httpProxy' || serverType == 'httpWeb'">
|
||||
<option value="http">HTTP</option>
|
||||
<option value="https">HTTPS</option>
|
||||
</select>
|
||||
@@ -25,7 +25,7 @@
|
||||
<tr>
|
||||
<td class="title">源站地址 *</td>
|
||||
<td>
|
||||
<input type="text" name="addr" ref="focus"/>
|
||||
<input type="text" name="addr" ref="focus" v-model="addr" @input="changeAddr"/>
|
||||
<p class="comment">源站服务器地址,通常是一个IP(或域名)加端口<span v-if="serverType == 'httpProxy'">,不需要加 http:// 或 https://</span>。</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
Tea.context(function () {
|
||||
this.addr = ""
|
||||
this.protocol = ""
|
||||
|
||||
if (this.isHTTP) {
|
||||
this.protocol = "http"
|
||||
}
|
||||
|
||||
this.changeAddr = function () {
|
||||
if (this.serverType == "httpProxy") {
|
||||
if (this.addr.startsWith("http://")) {
|
||||
this.protocol = "http"
|
||||
} else if (this.addr.startsWith("https://")) {
|
||||
this.protocol = "https"
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -27,7 +27,7 @@
|
||||
<tr>
|
||||
<td class="title">源站地址</td>
|
||||
<td>
|
||||
<input type="text" name="addr" ref="focus" v-model="origin.addr"/>
|
||||
<input type="text" name="addr" ref="focus" v-model="origin.addr" @input="changeAddr"/>
|
||||
<p class="comment">源站服务器地址,通常是一个IP(或域名)加端口<span v-if="serverType == 'httpProxy'">,不需要加 http:// 或 https://</span>。</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
Tea.context(function () {
|
||||
this.changeAddr = function () {
|
||||
if (this.serverType == "httpProxy") {
|
||||
if (this.origin.addr.startsWith("http://")) {
|
||||
this.origin.protocol = "http"
|
||||
} else if (this.origin.addr.startsWith("https://")) {
|
||||
this.origin.protocol = "https"
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user