WAF操作符对应的对比值可以不填写

This commit is contained in:
GoEdgeLab
2023-12-07 20:24:26 +08:00
parent c568990349
commit ca53871e56
3 changed files with 29 additions and 5 deletions

View File

@@ -37,7 +37,7 @@ Vue.component("http-firewall-rules-box", {
})
},
operatorName: function (operatorCode) {
var operatorName = operatorCode
let operatorName = operatorCode
if (typeof (window.WAF_RULE_OPERATORS) != null) {
window.WAF_RULE_OPERATORS.forEach(function (v) {
if (v.code == operatorCode) {
@@ -48,6 +48,18 @@ Vue.component("http-firewall-rules-box", {
return operatorName
},
operatorDataType: function (operatorCode) {
let operatorDataType = "none"
if (typeof (window.WAF_RULE_OPERATORS) != null) {
window.WAF_RULE_OPERATORS.forEach(function (v) {
if (v.code == operatorCode) {
operatorDataType = v.dataType
}
})
}
return operatorDataType
},
isEmptyString: function (v) {
return typeof v == "string" && v.length == 0
}
@@ -72,7 +84,7 @@ Vue.component("http-firewall-rules-box", {
<span v-else>
<span v-if="rule.paramFilters != null && rule.paramFilters.length > 0" v-for="paramFilter in rule.paramFilters"> | {{paramFilter.code}}</span> <span :class="{dash:(!rule.isComposed && rule.isCaseInsensitive)}" :title="(!rule.isComposed && rule.isCaseInsensitive) ? '大小写不敏感':''">{{operatorName(rule.operator)}}</span>
<span v-if="!isEmptyString(rule.value)">{{rule.value}}</span>
<span v-else class="disabled" style="font-weight: normal" title="空字符串">[空]</span>
<span v-else-if="operatorDataType(rule.operator) != 'none'" class="disabled" style="font-weight: normal" title="空字符串">[空]</span>
</span>
<!-- description -->