From beb34f82646c26c74b02f5b74b753c2763e01c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Mon, 20 Sep 2021 20:01:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E8=AE=BE=E7=BD=AE=E9=9B=86?= =?UTF-8?q?=E7=BE=A4=E7=9A=84DNS=E8=AE=B0=E5=BD=95TTL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/clusters/cluster/settings/dns/index.go | 3 +++ .../web/actions/default/dns/updateClusterPopup.go | 6 +++++- .../clusters/cluster/settings/dns/index.html | 12 +++++++++++- web/views/@default/dns/updateClusterPopup.html | 12 +++++++++++- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/internal/web/actions/default/clusters/cluster/settings/dns/index.go b/internal/web/actions/default/clusters/cluster/settings/dns/index.go index 781c723b..951eeac9 100644 --- a/internal/web/actions/default/clusters/cluster/settings/dns/index.go +++ b/internal/web/actions/default/clusters/cluster/settings/dns/index.go @@ -51,6 +51,7 @@ func (this *IndexAction) RunGet(params struct { } else { this.Data["cnameRecords"] = dnsInfoResp.CnameRecords } + this.Data["ttl"] = dnsInfoResp.Ttl this.Show() } @@ -63,6 +64,7 @@ func (this *IndexAction) RunPost(params struct { NodesAutoSync bool ServersAutoSync bool CnameRecords []string + Ttl int32 Must *actions.Must CSRF *actionutils.CSRF @@ -105,6 +107,7 @@ func (this *IndexAction) RunPost(params struct { NodesAutoSync: params.NodesAutoSync, ServersAutoSync: params.ServersAutoSync, CnameRecords: params.CnameRecords, + Ttl: params.Ttl, }) if err != nil { this.ErrorPage(err) diff --git a/internal/web/actions/default/dns/updateClusterPopup.go b/internal/web/actions/default/dns/updateClusterPopup.go index cab1031c..157a31a5 100644 --- a/internal/web/actions/default/dns/updateClusterPopup.go +++ b/internal/web/actions/default/dns/updateClusterPopup.go @@ -9,7 +9,7 @@ import ( "github.com/iwind/TeaGo/maps" ) -// 修改集群的DNS设置 +// UpdateClusterPopupAction 修改集群的DNS设置 type UpdateClusterPopupAction struct { actionutils.ParentAction } @@ -52,6 +52,8 @@ func (this *UpdateClusterPopupAction) RunGet(params struct { this.Data["cnameRecords"] = dnsResp.CnameRecords } + this.Data["ttl"] = dnsResp.Ttl + // 所有服务商 providerTypesResp, err := this.RPC().DNSProviderRPC().FindAllDNSProviderTypes(this.AdminContext(), &pb.FindAllDNSProviderTypesRequest{}) if err != nil { @@ -77,6 +79,7 @@ func (this *UpdateClusterPopupAction) RunPost(params struct { NodesAutoSync bool ServersAutoSync bool CnameRecords []string + Ttl int32 Must *actions.Must CSRF *actionutils.CSRF @@ -111,6 +114,7 @@ func (this *UpdateClusterPopupAction) RunPost(params struct { NodesAutoSync: params.NodesAutoSync, ServersAutoSync: params.ServersAutoSync, CnameRecords: params.CnameRecords, + Ttl: params.Ttl, }) if err != nil { this.ErrorPage(err) diff --git a/web/views/@default/clusters/cluster/settings/dns/index.html b/web/views/@default/clusters/cluster/settings/dns/index.html index d1c3a171..baf096c6 100644 --- a/web/views/@default/clusters/cluster/settings/dns/index.html +++ b/web/views/@default/clusters/cluster/settings/dns/index.html @@ -30,13 +30,23 @@ 自动设置CNAME记录 -

除了集群节点记录之外,自动加入的CNAME记录,比如@www

+

除集群已创建的网站服务之外,自动解析到集群的CNAME记录,比如@www

+ + 记录TTL + +
+ + +
+

每个DNS服务商或者账号的TTL限制各有不同,请注意取值范围。0表示使用默认。

+ + 是否同步节点DNS状态 diff --git a/web/views/@default/dns/updateClusterPopup.html b/web/views/@default/dns/updateClusterPopup.html index b906dcaf..925ea8cc 100644 --- a/web/views/@default/dns/updateClusterPopup.html +++ b/web/views/@default/dns/updateClusterPopup.html @@ -48,13 +48,23 @@ 自动设置CNAME记录 -

除了集群节点记录之外,自动加入的CNAME记录,比如@www

+

除集群已创建的网站服务之外,自动解析到集群的CNAME记录,比如@www

+ + 记录TTL + +
+ + +
+

每个DNS服务商或者账号的TTL限制各有不同,请注意取值范围。0表示使用默认。

+ + 是否同步节点DNS状态