mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-14 04:10:26 +08:00
WAF支持忽略全局WAF规则
This commit is contained in:
@@ -6,39 +6,59 @@ Vue.component("http-firewall-config-box", {
|
|||||||
firewall = {
|
firewall = {
|
||||||
isPrior: false,
|
isPrior: false,
|
||||||
isOn: false,
|
isOn: false,
|
||||||
firewallPolicyId: 0
|
firewallPolicyId: 0,
|
||||||
|
ignoreGlobalRules: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
firewall: firewall
|
firewall: firewall,
|
||||||
|
moreOptionsVisible: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
changeOptionsVisible: function (v) {
|
||||||
|
this.moreOptionsVisible = v
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
template: `<div>
|
template: `<div>
|
||||||
<input type="hidden" name="firewallJSON" :value="JSON.stringify(firewall)"/>
|
<input type="hidden" name="firewallJSON" :value="JSON.stringify(firewall)"/>
|
||||||
|
|
||||||
|
<table class="ui table selectable definition" v-show="!vIsGroup">
|
||||||
|
<tr>
|
||||||
|
<td class="title">全局WAF策略</td>
|
||||||
|
<td>
|
||||||
|
<div v-if="vFirewallPolicy != null">{{vFirewallPolicy.name}} <span v-if="vFirewallPolicy.modeInfo != null"> <span :class="{green: vFirewallPolicy.modeInfo.code == 'defend', blue: vFirewallPolicy.modeInfo.code == 'observe', grey: vFirewallPolicy.modeInfo.code == 'bypass'}">[{{vFirewallPolicy.modeInfo.name}}]</span> </span> <link-icon :href="'/servers/components/waf/policy?firewallPolicyId=' + vFirewallPolicy.id"></link-icon>
|
||||||
|
<p class="comment">当前服务所在集群的设置。</p>
|
||||||
|
</div>
|
||||||
|
<span v-else class="red">当前集群没有设置WAF策略,当前配置无法生效。</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
<table class="ui table selectable definition">
|
<table class="ui table selectable definition">
|
||||||
<prior-checkbox :v-config="firewall" v-if="vIsLocation || vIsGroup"></prior-checkbox>
|
<prior-checkbox :v-config="firewall" v-if="vIsLocation || vIsGroup"></prior-checkbox>
|
||||||
<tbody v-show="(!vIsLocation && !vIsGroup) || firewall.isPrior">
|
<tbody v-show="(!vIsLocation && !vIsGroup) || firewall.isPrior">
|
||||||
<tr v-show="!vIsGroup">
|
|
||||||
<td>WAF策略</td>
|
|
||||||
<td>
|
|
||||||
<div v-if="vFirewallPolicy != null">{{vFirewallPolicy.name}} <span v-if="vFirewallPolicy.modeInfo != null"> <span :class="{green: vFirewallPolicy.modeInfo.code == 'defend', blue: vFirewallPolicy.modeInfo.code == 'observe', grey: vFirewallPolicy.modeInfo.code == 'bypass'}">[{{vFirewallPolicy.modeInfo.name}}]</span> </span> <link-icon :href="'/servers/components/waf/policy?firewallPolicyId=' + vFirewallPolicy.id"></link-icon>
|
|
||||||
<p class="comment">使用当前服务所在集群的设置。</p>
|
|
||||||
</div>
|
|
||||||
<span v-else class="red">当前集群没有设置WAF策略,当前配置无法生效。</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="title">启用WAF</td>
|
<td class="title">启用WAF</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="ui checkbox">
|
<checkbox v-model="firewall.isOn"></checkbox>
|
||||||
<input type="checkbox" v-model="firewall.isOn"/>
|
|
||||||
<label></label>
|
|
||||||
</div>
|
|
||||||
<p class="comment">启用WAF之后,各项WAF设置才会生效。</p>
|
<p class="comment">启用WAF之后,各项WAF设置才会生效。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2"><more-options-indicator @change="changeOptionsVisible"></more-options-indicator></td>
|
||||||
|
</tr>
|
||||||
|
<tbody v-show="moreOptionsVisible">
|
||||||
|
<tr>
|
||||||
|
<td>不使用全局规则</td>
|
||||||
|
<td>
|
||||||
|
<checkbox v-model="firewall.ignoreGlobalRules"></checkbox>
|
||||||
|
<p class="comment">选中后,表示<strong>不使用</strong>系统全局WAF策略中定义的规则。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="margin"></div>
|
<div class="margin"></div>
|
||||||
</div>`
|
</div>`
|
||||||
|
|||||||
Reference in New Issue
Block a user