diff --git a/internal/web/actions/default/servers/components/waf/createRulePopup.go b/internal/web/actions/default/servers/components/waf/createRulePopup.go index 042c8fde..6843029d 100644 --- a/internal/web/actions/default/servers/components/waf/createRulePopup.go +++ b/internal/web/actions/default/servers/components/waf/createRulePopup.go @@ -32,6 +32,7 @@ func (this *CreateRulePopupAction) RunGet(params struct { "params": checkpoint.Params, "options": checkpoint.Options, "isComposed": checkpoint.IsComposed, + "dataType": checkpoint.DataType, }) } } diff --git a/web/public/js/components/server/http-firewall-rules-box.js b/web/public/js/components/server/http-firewall-rules-box.js index 824b540d..a61b5c2c 100644 --- a/web/public/js/components/server/http-firewall-rules-box.js +++ b/web/public/js/components/server/http-firewall-rules-box.js @@ -14,6 +14,7 @@ Vue.component("http-firewall-rules-box", { window.UPDATING_RULE = null let that = this teaweb.popup("/servers/components/waf/createRulePopup?type=" + this.vType, { + height: "30em", callback: function (resp) { that.rules.push(resp.data.rule) } @@ -23,6 +24,7 @@ Vue.component("http-firewall-rules-box", { window.UPDATING_RULE = rule let that = this teaweb.popup("/servers/components/waf/createRulePopup?type=" + this.vType, { + height: "30em", callback: function (resp) { Vue.set(that.rules, index, resp.data.rule) } diff --git a/web/views/@default/servers/components/waf/createRulePopup.html b/web/views/@default/servers/components/waf/createRulePopup.html index 6bbd6e3e..9501f57a 100644 --- a/web/views/@default/servers/components/waf/createRulePopup.html +++ b/web/views/@default/servers/components/waf/createRulePopup.html @@ -91,7 +91,7 @@ - 正则表达式 + 正则表达式 对比值 @@ -105,6 +105,15 @@

将二进制进行Base64Encode后放在这里,比如Hello对应SGVsbG8=

+ +
+ +
+ @@ -132,7 +141,7 @@ - + 正则表达式测试 [输入测试字符串] @@ -147,7 +156,7 @@ - + 不区分大小写
diff --git a/web/views/@default/servers/components/waf/createRulePopup.js b/web/views/@default/servers/components/waf/createRulePopup.js index 8f800b40..9d1b6b7b 100644 --- a/web/views/@default/servers/components/waf/createRulePopup.js +++ b/web/views/@default/servers/components/waf/createRulePopup.js @@ -52,6 +52,19 @@ Tea.context(function () { this.checkpoint = this.checkpoints.$find(function (k, v) { return v.prefix == that.rule.checkpointPrefix }) + if (this.checkpoint == null) { + return + } + switch (this.checkpoint.dataType) { + case "bool": + this.rule.operator = "eq" + break + case "number": + this.rule.operator = "eq" + break + default: + this.rule.operator = "match" + } } @@ -63,6 +76,9 @@ Tea.context(function () { this.operator = this.operators.$find(function (k, v) { return v.code == that.rule.operator }) + if (this.operator == null) { + return + } if (!this.isUpdating) { this.rule.isCaseInsensitive = (this.operator.case == "yes") } diff --git a/web/views/@default/servers/components/waf/group.js b/web/views/@default/servers/components/waf/group.js index 82cfc41b..5520cb37 100644 --- a/web/views/@default/servers/components/waf/group.js +++ b/web/views/@default/servers/components/waf/group.js @@ -34,7 +34,7 @@ Tea.context(function () { this.createSet = function (groupId) { teaweb.popup("/servers/components/waf/createSetPopup?firewallPolicyId=" + this.firewallPolicyId + "&groupId=" + groupId + "&type=" + this.type, { width: "50em", - height: "30em", + height: "40em", callback: function () { teaweb.success("保存成功", function () { window.location.reload() @@ -47,7 +47,7 @@ Tea.context(function () { this.updateSet = function (setId) { teaweb.popup("/servers/components/waf/updateSetPopup?firewallPolicyId=" + this.firewallPolicyId + "&groupId=" + this.group.id + "&type=" + this.type + "&setId=" + setId, { width: "50em", - height: "30em", + height: "40em", callback: function () { teaweb.success("保存成功", function () { window.location.reload() diff --git a/web/views/@default/servers/groups/group/settings/waf/group.js b/web/views/@default/servers/groups/group/settings/waf/group.js index 5638a956..351312bd 100644 --- a/web/views/@default/servers/groups/group/settings/waf/group.js +++ b/web/views/@default/servers/groups/group/settings/waf/group.js @@ -35,7 +35,7 @@ Tea.context(function () { this.createSet = function (groupId) { teaweb.popup("/servers/components/waf/createSetPopup?firewallPolicyId=" + this.firewallPolicyId + "&groupId=" + groupId + "&type=" + this.type, { width: "50em", - height: "30em", + height: "40em", callback: function () { teaweb.success("保存成功", function () { window.location.reload() @@ -48,7 +48,7 @@ Tea.context(function () { this.updateSet = function (setId) { teaweb.popup("/servers/components/waf/updateSetPopup?firewallPolicyId=" + this.firewallPolicyId + "&groupId=" + this.group.id + "&type=" + this.type + "&setId=" + setId, { width: "50em", - height: "30em", + height: "40em", callback: function () { teaweb.success("保存成功", function () { window.location.reload() diff --git a/web/views/@default/servers/server/settings/waf/group.js b/web/views/@default/servers/server/settings/waf/group.js index 5638a956..351312bd 100644 --- a/web/views/@default/servers/server/settings/waf/group.js +++ b/web/views/@default/servers/server/settings/waf/group.js @@ -35,7 +35,7 @@ Tea.context(function () { this.createSet = function (groupId) { teaweb.popup("/servers/components/waf/createSetPopup?firewallPolicyId=" + this.firewallPolicyId + "&groupId=" + groupId + "&type=" + this.type, { width: "50em", - height: "30em", + height: "40em", callback: function () { teaweb.success("保存成功", function () { window.location.reload() @@ -48,7 +48,7 @@ Tea.context(function () { this.updateSet = function (setId) { teaweb.popup("/servers/components/waf/updateSetPopup?firewallPolicyId=" + this.firewallPolicyId + "&groupId=" + this.group.id + "&type=" + this.type + "&setId=" + setId, { width: "50em", - height: "30em", + height: "40em", callback: function () { teaweb.success("保存成功", function () { window.location.reload()