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状态