mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 20:40:26 +08:00
WAF策略增加是否使用本地防火墙设置
This commit is contained in:
@@ -17,7 +17,7 @@ type IndexAction struct {
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "", "update")
|
||||
this.Nav("", "node", "update")
|
||||
this.SecondMenu("cache")
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ type IndexAction struct {
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "", "update")
|
||||
this.Nav("", "node", "update")
|
||||
this.SecondMenu("dns")
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ type IndexAction struct {
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "", "update")
|
||||
this.Nav("", "node", "update")
|
||||
this.SecondMenu("ssh")
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ type IndexAction struct {
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "", "update")
|
||||
this.Nav("", "node", "update")
|
||||
this.SecondMenu("system")
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ type IndexAction struct {
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "", "update")
|
||||
this.Nav("", "node", "update")
|
||||
this.SecondMenu("threshold")
|
||||
}
|
||||
|
||||
|
||||
@@ -85,14 +85,15 @@ func (this *PolicyAction) RunGet(params struct {
|
||||
firewallPolicy.Mode = firewallconfigs.FirewallModeDefend
|
||||
}
|
||||
this.Data["firewallPolicy"] = maps.Map{
|
||||
"id": firewallPolicy.Id,
|
||||
"name": firewallPolicy.Name,
|
||||
"isOn": firewallPolicy.IsOn,
|
||||
"description": firewallPolicy.Description,
|
||||
"mode": firewallPolicy.Mode,
|
||||
"modeInfo": firewallconfigs.FindFirewallMode(firewallPolicy.Mode),
|
||||
"groups": internalGroups,
|
||||
"blockOptions": firewallPolicy.BlockOptions,
|
||||
"id": firewallPolicy.Id,
|
||||
"name": firewallPolicy.Name,
|
||||
"isOn": firewallPolicy.IsOn,
|
||||
"description": firewallPolicy.Description,
|
||||
"mode": firewallPolicy.Mode,
|
||||
"modeInfo": firewallconfigs.FindFirewallMode(firewallPolicy.Mode),
|
||||
"groups": internalGroups,
|
||||
"blockOptions": firewallPolicy.BlockOptions,
|
||||
"useLocalFirewall": firewallPolicy.UseLocalFirewall,
|
||||
}
|
||||
|
||||
// 正在使用此策略的集群
|
||||
|
||||
@@ -49,12 +49,13 @@ func (this *UpdateAction) RunGet(params struct {
|
||||
this.Data["modes"] = firewallconfigs.FindAllFirewallModes()
|
||||
|
||||
this.Data["firewallPolicy"] = maps.Map{
|
||||
"id": firewallPolicy.Id,
|
||||
"name": firewallPolicy.Name,
|
||||
"description": firewallPolicy.Description,
|
||||
"isOn": firewallPolicy.IsOn,
|
||||
"mode": firewallPolicy.Mode,
|
||||
"blockOptions": firewallPolicy.BlockOptions,
|
||||
"id": firewallPolicy.Id,
|
||||
"name": firewallPolicy.Name,
|
||||
"description": firewallPolicy.Description,
|
||||
"isOn": firewallPolicy.IsOn,
|
||||
"mode": firewallPolicy.Mode,
|
||||
"blockOptions": firewallPolicy.BlockOptions,
|
||||
"useLocalFirewall": firewallPolicy.UseLocalFirewall,
|
||||
}
|
||||
|
||||
// 预置分组
|
||||
@@ -87,6 +88,7 @@ func (this *UpdateAction) RunPost(params struct {
|
||||
Description string
|
||||
IsOn bool
|
||||
Mode string
|
||||
UseLocalFirewall bool
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
@@ -112,6 +114,7 @@ func (this *UpdateAction) RunPost(params struct {
|
||||
FirewallGroupCodes: params.GroupCodes,
|
||||
BlockOptionsJSON: params.BlockOptionsJSON,
|
||||
Mode: params.Mode,
|
||||
UseLocalFirewall: params.UseLocalFirewall,
|
||||
})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
|
||||
Reference in New Issue
Block a user