优化代码/自动去除域名中的http://和https://等,防止误填

This commit is contained in:
刘祥超
2022-07-17 17:12:44 +08:00
parent 04f8bfc975
commit aef84189a4
10 changed files with 65 additions and 30 deletions

View File

@@ -44,6 +44,9 @@ Vue.component("plan-bandwidth-ranges", {
return -1
}
if (v1.minMB == v2.minMB) {
if (v2.maxMB == 0 || v1.maxMB < v2.maxMB) {
return -1
}
return 0
}
return 1

View File

@@ -183,7 +183,7 @@ Vue.component("reverse-proxy-box", {
</td>
</tr>
<tr v-show="family == null || family == 'http'">
<td>回源主机名不包含端口</td>
<td>回源主机名移除端口</td>
<td><checkbox v-model="reverseProxyConfig.requestHostExcludingPort"></checkbox>
<p class="comment">选中后表示移除回源主机名中的端口部分。</p>
</td>

View File

@@ -45,6 +45,13 @@
<td colspan="2"><more-options-indicator></more-options-indicator></td>
</tr>
<tbody v-show="moreOptionsVisible">
<tr>
<td>允许通过CNAME访问网站服务</td>
<td>
<checkbox name="cnameAsDomain" v-model="cnameAsDomain"></checkbox>
<p class="comment">选中后表示允许使用CNAME直接访问网站服务如果取消选中则表示CNAME只作为DNS解析记录使用。</p>
</td>
</tr>
<tr>
<td>记录TTL</td>
<td>
@@ -54,13 +61,6 @@
</div>
<p class="comment">每个DNS服务商或者账号的TTL限制各有不同请注意取值范围。0表示使用默认。</p>
</td>
</tr>
<tr>
<td>允许通过CNAME访问网站服务</td>
<td>
<checkbox name="cnameAsDomain" v-model="cnameAsDomain"></checkbox>
<p class="comment">选中后表示允许使用CNAME直接访问网站服务如果取消选中则表示CNAME只作为DNS解析记录使用。</p>
</td>
</tr>
<tr>
<td>是否同步节点DNS状态</td>

View File

@@ -9,14 +9,14 @@
<td class="title">单个域名 *</td>
<td>
<input type="text" name="serverName" ref="focus" maxlength="1024" v-model="serverName.name"/>
<p class="comment">请输入单个域名。</p>
<p class="comment">请输入单个域名,域名中<strong>不能</strong>包含<code-label>http</code-label><code-label>https</code-label></p>
</td>
</tr>
<tr v-if="mode == 'multiple'">
<td class="title">多个域名 *</td>
<td>
<textarea name="serverNames" ref="serverNames" v-model="multipleServerNames"></textarea>
<p class="comment">每行一个域名。</p>
<p class="comment">每行一个域名,域名中<strong>不能</strong>包含<code-label>http</code-label><code-label>https</code-label></p>
</td>
</tr>
</table>

View File

@@ -20,8 +20,10 @@ Tea.context(function () {
this.success = function () {
this.isOk = true
let f = NotifyReloadSuccess("任务提交成功")
f()
let that = this
teaweb.success("任务提交成功", function () {
window.location = window.location.pathname + "?keyType=" + that.keyType
})
}
this.fail = function (resp) {
@@ -39,5 +41,7 @@ Tea.context(function () {
/**
* 操作类型
*/
this.keyType = "key" // key | prefix
if (this.keyType == null || this.keyType.length == 0) {
this.keyType = "key" // key | prefix
}
})

View File

@@ -43,7 +43,7 @@
<td class="color-border">缓存文件句柄缓存</td>
<td>
<input type="text" name="fileOpenFileCacheMax" maxlength="6" value="0" style="width: 10em"/>
<p class="comment">保持缓存文件句柄,提升缓存文件打开速度,建议数量不超过缓存文件数量的10%</p>
<p class="comment">保持在内存中的缓存文件句柄的数量,提升缓存文件打开速度,建议数量不超过缓存文件数量的十分之一</p>
</td>
</tr>
<tr v-show="teaIsPlus">

View File

@@ -52,7 +52,7 @@
<td class="color-border">缓存文件句柄缓存</td>
<td>
<input type="text" name="fileOpenFileCacheMax" v-model="fileOpenFileCacheMax" maxlength="6" value="0" style="width: 10em"/>
<p class="comment">保持缓存文件句柄,提升缓存文件打开速度,建议数量缓存文件数量的10%</p>
<p class="comment">保持在内存中的缓存文件句柄的数量,提升缓存文件打开速度,建议数量不超过缓存文件数量的十分之一</p>
</td>
</tr>
<tr v-show="teaIsPlus">