mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-06 06:40:27 +08:00
WAF拦截动作可以设置最大封禁时间,从而实现封禁时间随机
This commit is contained in:
@@ -48,7 +48,7 @@ Vue.component("firewall-syn-flood-config-box", {
|
||||
<input type="hidden" name="synFloodJSON" :value="JSON.stringify(config)"/>
|
||||
<a href="" @click.prevent="edit">
|
||||
<span v-if="config.isOn">
|
||||
已启用 / <span>空连接次数:{{config.minAttempts}}次/分钟</span> / 封禁时间:{{config.timeoutSeconds}}秒 <span v-if="config.ignoreLocal">/ 忽略局域网访问</span>
|
||||
已启用 / <span>空连接次数:{{config.minAttempts}}次/分钟</span> / 封禁时长:{{config.timeoutSeconds}}秒 <span v-if="config.ignoreLocal">/ 忽略局域网访问</span>
|
||||
</span>
|
||||
<span v-else>未启用</span>
|
||||
<i class="icon angle" :class="{up: isEditing, down: !isEditing}"></i>
|
||||
@@ -73,7 +73,7 @@ Vue.component("firewall-syn-flood-config-box", {
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>封禁时间</td>
|
||||
<td>封禁时长</td>
|
||||
<td>
|
||||
<div class="ui input right labeled">
|
||||
<input type="text" v-model="timeoutSeconds" style="width: 5em" maxlength="8"/>
|
||||
|
||||
@@ -16,7 +16,7 @@ Vue.component("firewall-syn-flood-config-viewer", {
|
||||
},
|
||||
template: `<div>
|
||||
<span v-if="config.isOn">
|
||||
已启用 / <span>空连接次数:{{config.minAttempts}}次/分钟</span> / 封禁时间:{{config.timeoutSeconds}}秒 <span v-if="config.ignoreLocal">/ 忽略局域网访问</span>
|
||||
已启用 / <span>空连接次数:{{config.minAttempts}}次/分钟</span> / 封禁时长:{{config.timeoutSeconds}}秒 <span v-if="config.ignoreLocal">/ 忽略局域网访问</span>
|
||||
</span>
|
||||
<span v-else>未启用</span>
|
||||
</div>`
|
||||
|
||||
@@ -643,7 +643,7 @@ Vue.component("http-firewall-actions-box", {
|
||||
|
||||
<!-- block -->
|
||||
<tr v-if="actionCode == 'block'">
|
||||
<td>封锁时间</td>
|
||||
<td>封禁时长</td>
|
||||
<td>
|
||||
<div class="ui input right labeled">
|
||||
<input type="text" style="width: 5em" maxlength="9" v-model="blockTimeout" @keyup.enter="confirm()" @keypress.enter.prevent="1"/>
|
||||
@@ -652,14 +652,14 @@ Vue.component("http-firewall-actions-box", {
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="actionCode == 'block'">
|
||||
<td>封锁范围</td>
|
||||
<td>封禁范围</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" v-model="blockScope">
|
||||
<option value="service">当前服务</option>
|
||||
<option value="global">所有服务</option>
|
||||
</select>
|
||||
<p class="comment" v-if="blockScope == 'service'">只封锁用户对当前网站服务的访问,其他服务不受影响。</p>
|
||||
<p class="comment" v-if="blockScope =='global'">封锁用户对所有网站服务的访问。</p>
|
||||
<p class="comment" v-if="blockScope == 'service'">只封禁用户对当前网站服务的访问,其他服务不受影响。</p>
|
||||
<p class="comment" v-if="blockScope =='global'">封禁用户对所有网站服务的访问。</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ Vue.component("http-firewall-block-options-viewer", {
|
||||
template: `<div>
|
||||
<span v-if="options == null">默认设置</span>
|
||||
<div v-else>
|
||||
状态码:{{options.statusCode}} / 提示内容:<span v-if="options.body != null && options.body.length > 0">[{{options.body.length}}字符]</span><span v-else class="disabled">[无]</span> / 超时时间:{{options.timeout}}秒
|
||||
状态码:{{options.statusCode}} / 提示内容:<span v-if="options.body != null && options.body.length > 0">[{{options.body.length}}字符]</span><span v-else class="disabled">[无]</span> / 超时时间:{{options.timeout}}秒 <span v-if="options.timeoutMax > options.timeout">/ 最大封禁时长:{{options.timeoutMax}}秒</span>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
|
||||
@@ -5,6 +5,7 @@ Vue.component("http-firewall-block-options", {
|
||||
blockOptions: this.vBlockOptions,
|
||||
statusCode: this.vBlockOptions.statusCode,
|
||||
timeout: this.vBlockOptions.timeout,
|
||||
timeoutMax: this.vBlockOptions.timeoutMax,
|
||||
isEditing: false
|
||||
}
|
||||
},
|
||||
@@ -24,6 +25,14 @@ Vue.component("http-firewall-block-options", {
|
||||
} else {
|
||||
this.blockOptions.timeout = timeout
|
||||
}
|
||||
},
|
||||
timeoutMax: function (v) {
|
||||
let timeoutMax = parseInt(v)
|
||||
if (isNaN(timeoutMax)) {
|
||||
this.blockOptions.timeoutMax = 0
|
||||
} else {
|
||||
this.blockOptions.timeoutMax = timeoutMax
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -33,7 +42,9 @@ Vue.component("http-firewall-block-options", {
|
||||
},
|
||||
template: `<div>
|
||||
<input type="hidden" name="blockOptionsJSON" :value="JSON.stringify(blockOptions)"/>
|
||||
<a href="" @click.prevent="edit">状态码:{{statusCode}} / 提示内容:<span v-if="blockOptions.body != null && blockOptions.body.length > 0">[{{blockOptions.body.length}}字符]</span><span v-else class="disabled">[无]</span> / 超时时间:{{timeout}}秒 <i class="icon angle" :class="{up: isEditing, down: !isEditing}"></i></a>
|
||||
<a href="" @click.prevent="edit">状态码:{{statusCode}} / 提示内容:<span v-if="blockOptions.body != null && blockOptions.body.length > 0">[{{blockOptions.body.length}}字符]</span><span v-else class="disabled">[无]</span> <span v-if="timeout > 0"> / 封禁时长:{{timeout}}秒</span>
|
||||
<span v-if="timeoutMax > timeout"> / 最大封禁时长:{{timeoutMax}}秒</span>
|
||||
<i class="icon angle" :class="{up: isEditing, down: !isEditing}"></i></a>
|
||||
<table class="ui table" v-show="isEditing">
|
||||
<tr>
|
||||
<td class="title">状态码</td>
|
||||
@@ -48,13 +59,23 @@ Vue.component("http-firewall-block-options", {
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>超时时间</td>
|
||||
<td>封禁时长</td>
|
||||
<td>
|
||||
<div class="ui input right labeled">
|
||||
<input type="text" v-model="timeout" style="width: 5em" maxlength="6"/>
|
||||
<span class="ui label">秒</span>
|
||||
</div>
|
||||
<p class="comment">触发阻止动作时,封锁客户端IP的时间。</p>
|
||||
<p class="comment">触发阻止动作时,封禁客户端IP的时间。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>最大封禁时长</td>
|
||||
<td>
|
||||
<div class="ui input right labeled">
|
||||
<input type="text" v-model="timeoutMax" style="width: 5em" maxlength="6"/>
|
||||
<span class="ui label">秒</span>
|
||||
</div>
|
||||
<p class="comment">如果最大封禁时长大于封禁时长({{timeout}}秒),那么表示每次封禁的时候,将会在这两个时长数字之间随机选取一个数字作为最终的封禁时长。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user