WAF规则中如果对比值为空,则显示空字样

This commit is contained in:
刘祥超
2023-01-13 15:58:35 +08:00
parent e18f182ce6
commit bf82f22d0f
2 changed files with 11 additions and 2 deletions

View File

@@ -21,6 +21,9 @@ Vue.component("http-firewall-rule-label", {
} }
return operatorName return operatorName
},
isEmptyString: function (v) {
return typeof v == "string" && v.length == 0
} }
}, },
template: `<div> template: `<div>
@@ -41,7 +44,8 @@ Vue.component("http-firewall-rule-label", {
<span v-else> <span v-else>
<span v-if="rule.paramFilters != null && rule.paramFilters.length > 0" v-for="paramFilter in rule.paramFilters"> | {{paramFilter.code}}</span> <span v-if="rule.paramFilters != null && rule.paramFilters.length > 0" v-for="paramFilter in rule.paramFilters"> | {{paramFilter.code}}</span>
<span :class="{dash:rule.isCaseInsensitive}" :title="rule.isCaseInsensitive ? '大小写不敏感':''" v-if="!rule.isComposed">{{operatorName(rule.operator)}}</span> <span :class="{dash:rule.isCaseInsensitive}" :title="rule.isCaseInsensitive ? '大小写不敏感':''" v-if="!rule.isComposed">{{operatorName(rule.operator)}}</span>
{{rule.value}} <span v-if="!isEmptyString(rule.value)">{{rule.value}}</span>
<span v-else class="disabled" style="font-weight: normal" title="空字符串">[空]</span>
</span> </span>
<!-- description --> <!-- description -->

View File

@@ -47,6 +47,9 @@ Vue.component("http-firewall-rules-box", {
} }
return operatorName return operatorName
},
isEmptyString: function (v) {
return typeof v == "string" && v.length == 0
} }
}, },
template: `<div> template: `<div>
@@ -67,7 +70,9 @@ Vue.component("http-firewall-rules-box", {
</span> </span>
<span v-else> <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.isCaseInsensitive}" :title="rule.isCaseInsensitive ? '大小写不敏感':''">{{operatorName(rule.operator)}}</span> {{rule.value}} <span v-if="rule.paramFilters != null && rule.paramFilters.length > 0" v-for="paramFilter in rule.paramFilters"> | {{paramFilter.code}}</span> <span :class="{dash:rule.isCaseInsensitive}" :title="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> </span>
<!-- description --> <!-- description -->