WAF增加显示网页动作

This commit is contained in:
GoEdgeLab
2021-10-25 19:40:28 +08:00
parent b79d13a271
commit e3eed0c047

View File

@@ -46,6 +46,14 @@ Vue.component("http-firewall-actions-box", {
})
}
var defaultPageBody = `<!DOCTYPE html>
<html>
<body>
403 Forbidden
</body>
</html>`
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", {
<!-- tag -->
<span v-if="config.code == 'tag'">{{config.options.tags.join(", ")}}</span>
<!-- page -->
<span v-if="config.code == 'page'">[{{config.options.status}}]</span>
<!-- go_group -->
<span v-if="config.code == 'go_group'">{{config.options.groupName}}</span>
@@ -612,6 +653,18 @@ Vue.component("http-firewall-actions-box", {
</td>
</tr>
<!-- page -->
<tr v-if="actionCode == 'page'">
<td>状态码 *</td>
<td><input type="text" style="width: 4em" maxlength="3" v-model="pageStatus"/></td>
</tr>
<tr v-if="actionCode == 'page'">
<td>网页内容</td>
<td>
<textarea v-model="pageBody"></textarea>
</td>
</tr>
<!-- 规则分组 -->
<tr v-if="actionCode == 'go_group'">
<td>下一个分组 *</td>