mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 13:10: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)
 | 
			
		||||
 
 | 
			
		||||
@@ -51,6 +51,14 @@
 | 
			
		||||
            </div>
 | 
			
		||||
        </td>
 | 
			
		||||
    </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>
 | 
			
		||||
        <td>描述</td>
 | 
			
		||||
        <td>
 | 
			
		||||
 
 | 
			
		||||
@@ -37,6 +37,13 @@
 | 
			
		||||
					<http-firewall-block-options :v-block-options="firewallPolicy.blockOptions"></http-firewall-block-options>
 | 
			
		||||
				</td>
 | 
			
		||||
			</tr>
 | 
			
		||||
            <tr>
 | 
			
		||||
                <td>使用系统防火墙</td>
 | 
			
		||||
                <td>
 | 
			
		||||
                    <checkbox name="useLocalFirewall" v-model="firewallPolicy.useLocalFirewall"></checkbox>
 | 
			
		||||
                    <p class="comment">开启后,可以在合适的时候自动使用系统自带防火墙进行防御。</p>
 | 
			
		||||
                </td>
 | 
			
		||||
            </tr>
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td colspan="2"><more-options-indicator></more-options-indicator></td>
 | 
			
		||||
			</tr>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user