可以设置集群的DNS记录TTL

This commit is contained in:
GoEdgeLab
2021-09-20 20:01:15 +08:00
parent b7fd551acf
commit 31fd004bcb
4 changed files with 30 additions and 3 deletions

View File

@@ -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)

View File

@@ -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)