WAF模板中有新的规则时,可以在界面上收到提醒并点击加入

This commit is contained in:
刘祥超
2021-10-25 12:02:03 +08:00
parent b60c767fc5
commit 07ebbf0863
6 changed files with 167 additions and 1 deletions

View File

@@ -20,6 +20,10 @@
<td>预置的规则分组</td>
<td>
<span class="ui label tiny basic" v-for="group in firewallPolicy.groups" style="margin-bottom:0.5em" :class="{disabled:!group.isOn}">{{group.name}}</span>
<div v-if="upgradeItems.length > 0">
<div class="ui divider"></div>
<a href=""><span class="red">升级提醒:官方提供了新的规则,是否要加入以下规则:<span class="ui label tiny basic" v-for="item in upgradeItems" style="margin-bottom: 0.2em">{{item}}</span></span></a> &nbsp; &nbsp; <a href="" @click.prevent="upgradeTemplate">[加入]</a>
</div>
</td>
</tr>
<tr>

View File

@@ -0,0 +1,11 @@
Tea.context(function () {
this.upgradeTemplate = function () {
teaweb.confirm("确定要加入这些新规则吗?", function () {
this.$post(".upgradeTemplate")
.params({
policyId: this.firewallPolicy.id
})
.refresh()
})
}
})

View File

@@ -13,7 +13,7 @@
</tr>
<tr>
<td>规则 *</td>
<td>
<td style="word-break: break-word">
<http-firewall-rules-box :v-rules="rules" :v-type="type"></http-firewall-rules-box>
</td>
</tr>