From b62476b899714d851dd40cdf7a739e881d8ae338 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Mon, 18 Sep 2023 16:07:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E5=85=A8=E5=B1=80=E7=9A=84=E9=80=9A?= =?UTF-8?q?=E7=94=A8=E8=AE=BE=E7=BD=AE--=E5=9F=9F=E5=90=8D=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E8=AE=BE=E7=BD=AE=E7=A7=BB=E5=88=B0=E2=80=9C=E9=9B=86?= =?UTF-8?q?=E7=BE=A4=E8=AE=BE=E7=BD=AE--=E7=BD=91=E7=AB=99=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E2=80=9D=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../settings/global-server-config/index.go | 6 +++ .../default/servers/components/index.go | 3 -- .../web/actions/default/servers/status.go | 24 ++++++------ .../settings/global-server-config/index.html | 22 ++++++++++- .../@default/servers/components/index.html | 21 ----------- .../@default/servers/components/index.js | 37 +------------------ 6 files changed, 40 insertions(+), 73 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 400804f6..7b292272 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 @@ -100,6 +100,9 @@ func (this *IndexAction) RunPost(params struct { HttpAllNodeIPShowPage bool HttpAllEnableServerAddrVariable bool + HttpAllDomainAuditingIsOn bool + HttpAllDomainAuditingPrompt string + HttpAllServerName string HttpAllSupportsLowVersionHTTP bool HttpAllMatchCertFromAllServers bool @@ -172,6 +175,9 @@ func (this *IndexAction) RunPost(params struct { config.HTTPAll.NodeIPShowPage = params.HttpAllNodeIPShowPage config.HTTPAll.NodeIPPageHTML = params.HttpAllNodeIPPageHTML + config.HTTPAll.DomainAuditingIsOn = params.HttpAllDomainAuditingIsOn + config.HTTPAll.DomainAuditingPrompt = params.HttpAllDomainAuditingPrompt + // HTTP All config.HTTPAll.ServerName = params.HttpAllServerName config.HTTPAll.SupportsLowVersionHTTP = params.HttpAllSupportsLowVersionHTTP diff --git a/internal/web/actions/default/servers/components/index.go b/internal/web/actions/default/servers/components/index.go index 0bf54810..542ec887 100644 --- a/internal/web/actions/default/servers/components/index.go +++ b/internal/web/actions/default/servers/components/index.go @@ -31,9 +31,6 @@ func (this *IndexAction) RunGet(params struct{}) { valueJSON := valueJSONResp.ValueJSON globalConfig := &serverconfigs.GlobalConfig{} - // 默认值 - globalConfig.HTTPAll.DomainAuditingIsOn = false - if len(valueJSON) > 0 { err = json.Unmarshal(valueJSON, globalConfig) if err != nil { diff --git a/internal/web/actions/default/servers/status.go b/internal/web/actions/default/servers/status.go index b4d718bc..43b326d1 100644 --- a/internal/web/actions/default/servers/status.go +++ b/internal/web/actions/default/servers/status.go @@ -5,7 +5,6 @@ import ( "github.com/TeaOSLab/EdgeAdmin/internal/utils" "github.com/TeaOSLab/EdgeAdmin/internal/utils/numberutils" "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" - "github.com/TeaOSLab/EdgeCommon/pkg/rpc/dao" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" "github.com/iwind/TeaGo/maps" @@ -28,17 +27,7 @@ func (this *StatusAction) RunPost(params struct { } // 读取全局配置 - globalConfig, err := dao.SharedSysSettingDAO.ReadGlobalConfig(this.AdminContext()) - if err != nil { - this.ErrorPage(err) - return - } - auditingPrompt := "" - if globalConfig != nil { - auditingPrompt = globalConfig.HTTPAll.DomainAuditingPrompt - } - - wg := sync.WaitGroup{} + var wg = sync.WaitGroup{} wg.Add(len(params.ServerIds)) for _, serverId := range params.ServerIds { @@ -98,6 +87,17 @@ func (this *StatusAction) RunPost(params struct { if serverNamesResp.IsAuditing { m["type"] = "auditing" m["message"] = "审核中" + + auditingPromptResp, err := this.RPC().ServerRPC().FindServerAuditingPrompt(this.AdminContext(), &pb.FindServerAuditingPromptRequest{ServerId: serverId}) + if err != nil { + this.ErrorPage(err) + m["type"] = "serverErr" + m["message"] = "服务器错误" + m["todo"] = "错误信息:FindServerNames(): " + err.Error() + ",请联系管理员修复此问题" + return + } + + var auditingPrompt = auditingPromptResp.PromptText if len(auditingPrompt) > 0 { m["todo"] = auditingPrompt } else { 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 06d5f30e..a3bb35be 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 @@ -7,7 +7,7 @@ -

域名

+

域名绑定

@@ -81,6 +81,26 @@
+
+

域名审核

+ + + + + + + + + +
域名变更时需要审核 + +

选中后,用户在创建和修改域名时需要管理员审核通过才能生效。

+
审核提示 + +

提示用户需要审核的文字说明。

+
+
+

访问日志

diff --git a/web/views/@default/servers/components/index.html b/web/views/@default/servers/components/index.html index d5769530..c3b17aa4 100644 --- a/web/views/@default/servers/components/index.html +++ b/web/views/@default/servers/components/index.html @@ -1,33 +1,12 @@ {$layout} - -
-
- - - - - - - - -
域名变更时是否需要审核 - -

选中后,用户在修改域名时需要管理员审核通过才能生效。

-
审核提示 - -

提示用户需要审核的文字说明。

-
- -
diff --git a/web/views/@default/servers/components/index.js b/web/views/@default/servers/components/index.js index fe9c83e3..08c6a720 100644 --- a/web/views/@default/servers/components/index.js +++ b/web/views/@default/servers/components/index.js @@ -1,5 +1,5 @@ Tea.context(function () { - this.tab = "domainAuditing" + this.tab = "tcpPorts" this.$delay(function () { if (window.location.hash != null && window.location.hash.length > 1) { @@ -18,41 +18,6 @@ Tea.context(function () { }) } - /** - * 域名不匹配动作 - */ - this.domainMismatchAction = "page" - - this.domainMismatchActionPageOptions = { - statusCode: 404, - contentHTML: ` - - - -404 not found - - - -

Error: 404 Page Not Found

-

找不到您要访问的页面。

- -

原因:找不到当前访问域名对应的网站,请联系网站管理员。

- - -` - } - if (this.globalConfig.httpAll.domainMismatchAction != null) { - this.domainMismatchAction = this.globalConfig.httpAll.domainMismatchAction.code - - if (this.domainMismatchAction == "page") { - this.domainMismatchActionPageOptions = this.globalConfig.httpAll.domainMismatchAction.options; - } - } - /** * TCP端口 */