mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-09 16:50:26 +08:00
实现WAF部分功能
This commit is contained in:
43
web/views/@default/servers/components/waf/createSetPopup.js
Normal file
43
web/views/@default/servers/components/waf/createSetPopup.js
Normal file
@@ -0,0 +1,43 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyPopup
|
||||
|
||||
// rules
|
||||
this.rules = []
|
||||
|
||||
// connector
|
||||
this.selectedConnector = this.connectors[1].value
|
||||
this.selectedConnectorDescription = ""
|
||||
this.changeConnector = function () {
|
||||
let that = this
|
||||
this.selectedConnectorDescription = this.connectors.$find(function (k, v) {
|
||||
return v.value == that.selectedConnector
|
||||
}).description
|
||||
}
|
||||
this.changeConnector()
|
||||
|
||||
// action
|
||||
this.action = "block"
|
||||
|
||||
// action:go_group
|
||||
this.actionGroupId = 0
|
||||
|
||||
// action:go_set
|
||||
this.actionSetId = 0
|
||||
this.groupSets = function (groupId) {
|
||||
let group = null
|
||||
this.firewallPolicy.inbound.groups.forEach(function (v) {
|
||||
if (v.id == groupId) {
|
||||
group = v
|
||||
}
|
||||
})
|
||||
this.firewallPolicy.outbound.groups.forEach(function (v) {
|
||||
if (v.id == groupId) {
|
||||
group = v
|
||||
}
|
||||
})
|
||||
if (group == null) {
|
||||
return []
|
||||
}
|
||||
return group.sets
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user