在WAF规则产生错误时给予提示

This commit is contained in:
GoEdgeLab
2021-09-27 10:11:37 +08:00
parent 9e97271083
commit 84dd0d662b
4 changed files with 30 additions and 0 deletions

View File

@@ -6,6 +6,13 @@ Vue.component("http-firewall-rule-label", {
rule: this.vRule
}
},
methods: {
showErr: function (err) {
teaweb.popupTip("规则校验错误,请修正:<span class=\"red\">" + teaweb.encodeHTML(err) + "</span>")
},
},
template: `<div>
<div class="ui label tiny basic">
{{rule.name}}[{{rule.param}}]
@@ -19,6 +26,8 @@ Vue.component("http-firewall-rule-label", {
<var :class="{dash:rule.isCaseInsensitive}" :title="rule.isCaseInsensitive ? '大小写不敏感':''" v-if="!rule.isComposed">{{rule.operator}}</var>
{{rule.value}}
</span>
<a href="" v-if="rule.err != null && rule.err.length > 0" @click.prevent="showErr(rule.err)" style="color: #db2828; opacity: 1; border-bottom: 1px #db2828 dashed; margin-left: 0.5em">规则错误</a>
</div>
</div>`
})