From aa52d695e6d6bf0198c7aa394d35c54136bbc0bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Thu, 18 Apr 2024 16:15:40 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9B=86=E7=BE=A4=E8=AE=BE=E7=BD=AE--=E7=BD=91?= =?UTF-8?q?=E7=AB=99=E8=AE=BE=E7=BD=AE=E4=B8=AD=E5=A2=9E=E5=8A=A0=E2=80=9C?= =?UTF-8?q?=E8=87=AA=E5=8A=A8gzip=E5=9B=9E=E6=BA=90=E2=80=9D=E9=80=89?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cluster/settings/global-server-config/index.go | 2 ++ .../cluster/settings/global-server-config/index.html | 11 +++++++++-- .../cluster/settings/global-server-config/index.js | 6 +++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/internal/web/actions/default/clusters/cluster/settings/global-server-config/index.go b/internal/web/actions/default/clusters/cluster/settings/global-server-config/index.go index faaa4dd2..74a55a24 100644 --- a/internal/web/actions/default/clusters/cluster/settings/global-server-config/index.go +++ b/internal/web/actions/default/clusters/cluster/settings/global-server-config/index.go @@ -109,6 +109,7 @@ func (this *IndexAction) RunPost(params struct { HttpAllNodeIPPageHTML string HttpAllNodeIPShowPage bool HttpAllEnableServerAddrVariable bool + HttpAllRequestOriginsWithEncodings bool HttpAllDomainAuditingIsOn bool HttpAllDomainAuditingPrompt string @@ -217,6 +218,7 @@ func (this *IndexAction) RunPost(params struct { config.HTTPAll.ForceLnRequest = params.HttpAllForceLnRequest config.HTTPAll.LnRequestSchedulingMethod = params.HttpAllLnRequestSchedulingMethod config.HTTPAll.EnableServerAddrVariable = params.HttpAllEnableServerAddrVariable + config.HTTPAll.RequestOriginsWithEncodings = params.HttpAllRequestOriginsWithEncodings // 访问日志 config.HTTPAccessLog.IsOn = params.HttpAccessLogIsOn diff --git a/web/views/@default/clusters/cluster/settings/global-server-config/index.html b/web/views/@default/clusters/cluster/settings/global-server-config/index.html index b09fe1a2..c68309b5 100644 --- a/web/views/@default/clusters/cluster/settings/global-server-config/index.html +++ b/web/views/@default/clusters/cluster/settings/global-server-config/index.html @@ -4,7 +4,7 @@
- {{item.name}} + {{item.name}}
@@ -288,7 +288,14 @@ 支持${serverAddr}变量 -

支持在自定义页面中使用${serverAddr}变量,表示访客当前正在访问的服务器地址。

+

选中后,表示支持在自定义页面中使用${serverAddr}变量,用来表示访客当前正在访问的服务器地址。

+ + + + 自动gzip回源 + + +

选中后,表示自动使用Accept-Encoding: gzip, ...回源,可以用来节约源站流量。

diff --git a/web/views/@default/clusters/cluster/settings/global-server-config/index.js b/web/views/@default/clusters/cluster/settings/global-server-config/index.js index d5848772..8a82cae0 100644 --- a/web/views/@default/clusters/cluster/settings/global-server-config/index.js +++ b/web/views/@default/clusters/cluster/settings/global-server-config/index.js @@ -13,9 +13,13 @@ Tea.context(function () { if (textContent == null || textContent.length == 0) { textContent = elements[i].innerText } + let itemId = elements[i].getAttribute("id") + if (window.location.hash == "#" + itemId) { + this.currentItem = itemId + } this.titleMenus.push({ name: textContent, - id: elements[i].getAttribute("id") + id: itemId }) } })