From e3eed0c047848b34c5ed99a30e935f5f8eae5d9f Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Mon, 25 Oct 2021 19:40:28 +0800 Subject: [PATCH] =?UTF-8?q?WAF=E5=A2=9E=E5=8A=A0=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=BD=91=E9=A1=B5=E5=8A=A8=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/http-firewall-actions-box.js | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/web/public/js/components/server/http-firewall-actions-box.js b/web/public/js/components/server/http-firewall-actions-box.js index 8026f1a1..4ecf6b82 100644 --- a/web/public/js/components/server/http-firewall-actions-box.js +++ b/web/public/js/components/server/http-firewall-actions-box.js @@ -46,6 +46,14 @@ Vue.component("http-firewall-actions-box", { }) } + var defaultPageBody = ` + + +403 Forbidden + +` + + return { id: id, @@ -76,6 +84,10 @@ Vue.component("http-firewall-actions-box", { tagTags: [], + pageStatus: 403, + pageBody: defaultPageBody, + defaultPageBody: defaultPageBody, + goGroupName: "", goGroupId: 0, goGroup: null, @@ -187,6 +199,9 @@ Vue.component("http-firewall-actions-box", { this.tagTags = [] + this.pageStatus = 403 + this.pageBody = this.defaultPageBody + this.goGroupName = "" this.goGroupId = 0 this.goGroup = null @@ -277,6 +292,17 @@ Vue.component("http-firewall-actions-box", { if (config.options.tags != null) { this.tagTags = config.options.tags } + break + case "page": + this.pageStatus = 403 + this.pageBody = this.defaultPageBody + if (config.options.status != null) { + this.pageStatus = config.options.status + } + if (config.options.body != null) { + this.pageBody = config.options.body + } + break case "go_group": if (config.options != null) { @@ -351,6 +377,18 @@ Vue.component("http-firewall-actions-box", { this.actionOptions = { tags: this.tagTags } + } else if (this.actionCode == "page") { + let pageStatus = this.pageStatus.toString() + if (!pageStatus.match(/^\d{3}$/)) { + pageStatus = 403 + } else { + pageStatus = parseInt(pageStatus) + } + + this.actionOptions = { + status: pageStatus, + body: this.pageBody + } } else if (this.actionCode == "go_group") { // go_group let groupId = this.goGroupId if (typeof (groupId) == "string") { @@ -481,6 +519,9 @@ Vue.component("http-firewall-actions-box", { :{{config.options.tags.join(", ")}} + + :[{{config.options.status}}] + :{{config.options.groupName}} @@ -612,6 +653,18 @@ Vue.component("http-firewall-actions-box", { + + + 状态码 * + + + + 网页内容 + + + + + 下一个分组 *