From 38060873dfa5ed9a3bd1bd1bedb9534fb3ebf65c Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Mon, 18 Oct 2021 20:09:06 +0800 Subject: [PATCH] =?UTF-8?q?WAF=E9=98=BB=E6=AD=A2=E5=8A=A8=E4=BD=9C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B0=81=E9=94=81=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/settings/settingutils/helper.go | 5 +++- .../server/http-firewall-actions-box.js | 29 ++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/internal/web/actions/default/settings/settingutils/helper.go b/internal/web/actions/default/settings/settingutils/helper.go index 016595d4..812f7852 100644 --- a/internal/web/actions/default/settings/settingutils/helper.go +++ b/internal/web/actions/default/settings/settingutils/helper.go @@ -2,6 +2,7 @@ package settingutils import ( "github.com/TeaOSLab/EdgeAdmin/internal/configloaders" + teaconst "github.com/TeaOSLab/EdgeAdmin/internal/const" "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" "github.com/iwind/TeaGo/actions" ) @@ -31,7 +32,9 @@ func (this *Helper) BeforeAction(actionPtr actions.ActionWrapper) (goNext bool) if configloaders.AllowModule(adminId, configloaders.AdminModuleCodeSetting) { tabbar.Add("Web服务", "", "/settings/server", "", this.tab == "server") tabbar.Add("管理界面设置", "", "/settings/ui", "", this.tab == "ui") - tabbar.Add("用户界面设置", "", "/settings/user-ui", "", this.tab == "userUI") + if teaconst.IsPlus { + tabbar.Add("用户界面设置", "", "/settings/user-ui", "", this.tab == "userUI") + } tabbar.Add("安全设置", "", "/settings/security", "", this.tab == "security") tabbar.Add("IP库", "", "/settings/ip-library", "", this.tab == "ipLibrary") } 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 b0d8c731..8026f1a1 100644 --- a/web/public/js/components/server/http-firewall-actions-box.js +++ b/web/public/js/components/server/http-firewall-actions-box.js @@ -63,6 +63,8 @@ Vue.component("http-firewall-actions-box", { // 动作参数 blockTimeout: "", + blockScope: "global", + captchaLife: "", get302Life: "", post307Life: "", @@ -97,6 +99,9 @@ Vue.component("http-firewall-actions-box", { this.actionOptions["timeout"] = v } }, + blockScope: function (v) { + this.actionOptions["scope"] = v + }, captchaLife: function (v) { v = parseInt(v) if (isNaN(v)) { @@ -169,6 +174,7 @@ Vue.component("http-firewall-actions-box", { // 动作参数 this.blockTimeout = "" + this.blockScope = "global" this.captchaLife = "" this.get302Life = "" this.post307Life = "" @@ -220,6 +226,11 @@ Vue.component("http-firewall-actions-box", { if (config.options.timeout != null || config.options.timeout > 0) { this.blockTimeout = config.options.timeout.toString() } + if (config.options.scope != null && config.options.scope.length > 0) { + this.blockScope = config.options.scope + } else { + this.blockScope = "service" // 兼容先前版本遗留的默认值 + } break case "allow": break @@ -450,7 +461,7 @@ Vue.component("http-firewall-actions-box", {
- {{config.name}} ({{config.code.toUpperCase()}}) + {{config.name}} ({{config.code.toUpperCase()}}) :有效期{{config.options.timeout}}秒 @@ -476,6 +487,13 @@ Vue.component("http-firewall-actions-box", { :{{config.options.groupName}} / {{config.options.setName}} + + +   + [所有服务] + [当前服务] + +      
@@ -503,6 +521,15 @@ Vue.component("http-firewall-actions-box", {
+ + 封锁范围 + + + +