WAF策略增加是否使用本地防火墙设置

This commit is contained in:
刘祥超
2022-01-09 17:05:51 +08:00
parent d5e851cff7
commit 0bdda313da
9 changed files with 38 additions and 19 deletions

View File

@@ -17,7 +17,7 @@ type IndexAction struct {
} }
func (this *IndexAction) Init() { func (this *IndexAction) Init() {
this.Nav("", "", "update") this.Nav("", "node", "update")
this.SecondMenu("cache") this.SecondMenu("cache")
} }

View File

@@ -16,7 +16,7 @@ type IndexAction struct {
} }
func (this *IndexAction) Init() { func (this *IndexAction) Init() {
this.Nav("", "", "update") this.Nav("", "node", "update")
this.SecondMenu("dns") this.SecondMenu("dns")
} }

View File

@@ -17,7 +17,7 @@ type IndexAction struct {
} }
func (this *IndexAction) Init() { func (this *IndexAction) Init() {
this.Nav("", "", "update") this.Nav("", "node", "update")
this.SecondMenu("ssh") this.SecondMenu("ssh")
} }

View File

@@ -15,7 +15,7 @@ type IndexAction struct {
} }
func (this *IndexAction) Init() { func (this *IndexAction) Init() {
this.Nav("", "", "update") this.Nav("", "node", "update")
this.SecondMenu("system") this.SecondMenu("system")
} }

View File

@@ -15,7 +15,7 @@ type IndexAction struct {
} }
func (this *IndexAction) Init() { func (this *IndexAction) Init() {
this.Nav("", "", "update") this.Nav("", "node", "update")
this.SecondMenu("threshold") this.SecondMenu("threshold")
} }

View File

@@ -93,6 +93,7 @@ func (this *PolicyAction) RunGet(params struct {
"modeInfo": firewallconfigs.FindFirewallMode(firewallPolicy.Mode), "modeInfo": firewallconfigs.FindFirewallMode(firewallPolicy.Mode),
"groups": internalGroups, "groups": internalGroups,
"blockOptions": firewallPolicy.BlockOptions, "blockOptions": firewallPolicy.BlockOptions,
"useLocalFirewall": firewallPolicy.UseLocalFirewall,
} }
// 正在使用此策略的集群 // 正在使用此策略的集群

View File

@@ -55,6 +55,7 @@ func (this *UpdateAction) RunGet(params struct {
"isOn": firewallPolicy.IsOn, "isOn": firewallPolicy.IsOn,
"mode": firewallPolicy.Mode, "mode": firewallPolicy.Mode,
"blockOptions": firewallPolicy.BlockOptions, "blockOptions": firewallPolicy.BlockOptions,
"useLocalFirewall": firewallPolicy.UseLocalFirewall,
} }
// 预置分组 // 预置分组
@@ -87,6 +88,7 @@ func (this *UpdateAction) RunPost(params struct {
Description string Description string
IsOn bool IsOn bool
Mode string Mode string
UseLocalFirewall bool
Must *actions.Must Must *actions.Must
}) { }) {
@@ -112,6 +114,7 @@ func (this *UpdateAction) RunPost(params struct {
FirewallGroupCodes: params.GroupCodes, FirewallGroupCodes: params.GroupCodes,
BlockOptionsJSON: params.BlockOptionsJSON, BlockOptionsJSON: params.BlockOptionsJSON,
Mode: params.Mode, Mode: params.Mode,
UseLocalFirewall: params.UseLocalFirewall,
}) })
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)

View File

@@ -51,6 +51,14 @@
</div> </div>
</td> </td>
</tr> </tr>
<tr>
<td>使用系统防火墙</td>
<td>
<span class="green" v-if="firewallPolicy.useLocalFirewall">启用</span>
<span class="disabled" v-if="!firewallPolicy.useLocalFirewall">不启用</span>
<p class="comment" v-if="firewallPolicy.useLocalFirewall">可以在合适的时候自动使用系统自带防火墙进行防御。</p>
</td>
</tr>
<tr> <tr>
<td>描述</td> <td>描述</td>
<td> <td>

View File

@@ -37,6 +37,13 @@
<http-firewall-block-options :v-block-options="firewallPolicy.blockOptions"></http-firewall-block-options> <http-firewall-block-options :v-block-options="firewallPolicy.blockOptions"></http-firewall-block-options>
</td> </td>
</tr> </tr>
<tr>
<td>使用系统防火墙</td>
<td>
<checkbox name="useLocalFirewall" v-model="firewallPolicy.useLocalFirewall"></checkbox>
<p class="comment">开启后,可以在合适的时候自动使用系统自带防火墙进行防御。</p>
</td>
</tr>
<tr> <tr>
<td colspan="2"><more-options-indicator></more-options-indicator></td> <td colspan="2"><more-options-indicator></more-options-indicator></td>
</tr> </tr>