diff --git a/internal/web/actions/default/servers/components/waf/updateSetPopup.go b/internal/web/actions/default/servers/components/waf/updateSetPopup.go index d9e82471..1ccbd34d 100644 --- a/internal/web/actions/default/servers/components/waf/updateSetPopup.go +++ b/internal/web/actions/default/servers/components/waf/updateSetPopup.go @@ -56,7 +56,7 @@ func (this *UpdateSetPopupAction) RunGet(params struct { }, } - actionMaps := []maps.Map{} + var actionMaps = []maps.Map{} for _, action := range firewallconfigs.AllActions { actionMaps = append(actionMaps, maps.Map{ "name": action.Name, @@ -119,7 +119,7 @@ func (this *UpdateSetPopupAction) RunPost(params struct { if len(params.RulesJSON) == 0 { this.Fail("请添加至少一个规则") } - rules := []*firewallconfigs.HTTPFirewallRule{} + var rules = []*firewallconfigs.HTTPFirewallRule{} err = json.Unmarshal(params.RulesJSON, &rules) if err != nil { this.ErrorPage(err) diff --git a/web/public/js/components/server/http-firewall-actions-box.js b/web/public/js/components/server/http-firewall-actions-box.js index 205cec13..f186c971 100644 --- a/web/public/js/components/server/http-firewall-actions-box.js +++ b/web/public/js/components/server/http-firewall-actions-box.js @@ -1,6 +1,6 @@ // 动作选择 Vue.component("http-firewall-actions-box", { - props: ["v-actions", "v-firewall-policy", "v-action-configs"], + props: ["v-actions", "v-firewall-policy", "v-action-configs", "v-group-type"], mounted: function () { let that = this Tea.action("/servers/iplists/levelOptions") @@ -37,6 +37,13 @@ Vue.component("http-firewall-actions-box", { this.vFirewallPolicy.inbound.groups = [] } + if (this.vFirewallPolicy.outbound == null) { + this.vFirewallPolicy.outbound = {} + } + if (this.vFirewallPolicy.outbound.groups == null) { + this.vFirewallPolicy.outbound.groups = [] + } + let id = 0 let configs = [] if (this.vActionConfigs != null) { @@ -202,7 +209,16 @@ Vue.component("http-firewall-actions-box", { }) this.goGroup = group if (group == null) { - this.goGroupName = "" + // search outbound groups + group = this.vFirewallPolicy.outbound.groups.$find(function (k, v) { + return v.id == groupId + }) + if (group == null) { + this.goGroupName = "" + } else { + this.goGroup = group + this.goGroupName = group.name + } } else { this.goGroupName = group.name } @@ -677,8 +693,8 @@ Vue.component("http-firewall-actions-box", { - [所有服务] - [当前服务] + [所有网站] + [当前网站] @@ -703,8 +719,8 @@ Vue.component("http-firewall-actions-box", {
只封禁用户对当前网站的访问,其他服务不受影响。
封禁用户对所有网站的访问。
@@ -897,7 +913,8 @@ Vue.component("http-firewall-actions-box", {