mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 12:20:28 +08:00
WAF增加显示网页动作
This commit is contained in:
@@ -46,6 +46,14 @@ Vue.component("http-firewall-actions-box", {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var defaultPageBody = `<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
403 Forbidden
|
||||||
|
</body>
|
||||||
|
</html>`
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: id,
|
id: id,
|
||||||
|
|
||||||
@@ -76,6 +84,10 @@ Vue.component("http-firewall-actions-box", {
|
|||||||
|
|
||||||
tagTags: [],
|
tagTags: [],
|
||||||
|
|
||||||
|
pageStatus: 403,
|
||||||
|
pageBody: defaultPageBody,
|
||||||
|
defaultPageBody: defaultPageBody,
|
||||||
|
|
||||||
goGroupName: "",
|
goGroupName: "",
|
||||||
goGroupId: 0,
|
goGroupId: 0,
|
||||||
goGroup: null,
|
goGroup: null,
|
||||||
@@ -187,6 +199,9 @@ Vue.component("http-firewall-actions-box", {
|
|||||||
|
|
||||||
this.tagTags = []
|
this.tagTags = []
|
||||||
|
|
||||||
|
this.pageStatus = 403
|
||||||
|
this.pageBody = this.defaultPageBody
|
||||||
|
|
||||||
this.goGroupName = ""
|
this.goGroupName = ""
|
||||||
this.goGroupId = 0
|
this.goGroupId = 0
|
||||||
this.goGroup = null
|
this.goGroup = null
|
||||||
@@ -277,6 +292,17 @@ Vue.component("http-firewall-actions-box", {
|
|||||||
if (config.options.tags != null) {
|
if (config.options.tags != null) {
|
||||||
this.tagTags = config.options.tags
|
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
|
break
|
||||||
case "go_group":
|
case "go_group":
|
||||||
if (config.options != null) {
|
if (config.options != null) {
|
||||||
@@ -351,6 +377,18 @@ Vue.component("http-firewall-actions-box", {
|
|||||||
this.actionOptions = {
|
this.actionOptions = {
|
||||||
tags: this.tagTags
|
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
|
} else if (this.actionCode == "go_group") { // go_group
|
||||||
let groupId = this.goGroupId
|
let groupId = this.goGroupId
|
||||||
if (typeof (groupId) == "string") {
|
if (typeof (groupId) == "string") {
|
||||||
@@ -481,6 +519,9 @@ Vue.component("http-firewall-actions-box", {
|
|||||||
<!-- tag -->
|
<!-- tag -->
|
||||||
<span v-if="config.code == 'tag'">:{{config.options.tags.join(", ")}}</span>
|
<span v-if="config.code == 'tag'">:{{config.options.tags.join(", ")}}</span>
|
||||||
|
|
||||||
|
<!-- page -->
|
||||||
|
<span v-if="config.code == 'page'">:[{{config.options.status}}]</span>
|
||||||
|
|
||||||
<!-- go_group -->
|
<!-- go_group -->
|
||||||
<span v-if="config.code == 'go_group'">:{{config.options.groupName}}</span>
|
<span v-if="config.code == 'go_group'">:{{config.options.groupName}}</span>
|
||||||
|
|
||||||
@@ -612,6 +653,18 @@ Vue.component("http-firewall-actions-box", {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</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'">
|
<tr v-if="actionCode == 'go_group'">
|
||||||
<td>下一个分组 *</td>
|
<td>下一个分组 *</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user