在集群中可以设置自动加入DNS的CNAME记录

This commit is contained in:
GoEdgeLab
2021-09-20 16:37:41 +08:00
parent 9f855e4477
commit b7fd551acf
10 changed files with 65 additions and 1 deletions

View File

@@ -46,6 +46,12 @@ func (this *IndexAction) RunGet(params struct {
this.Data["domainName"] = dnsInfoResp.Domain.Name
}
if len(dnsInfoResp.CnameRecords) == 0 {
this.Data["cnameRecords"] = []string{}
} else {
this.Data["cnameRecords"] = dnsInfoResp.CnameRecords
}
this.Show()
}
@@ -56,6 +62,7 @@ func (this *IndexAction) RunPost(params struct {
DnsName string
NodesAutoSync bool
ServersAutoSync bool
CnameRecords []string
Must *actions.Must
CSRF *actionutils.CSRF
@@ -97,6 +104,7 @@ func (this *IndexAction) RunPost(params struct {
DnsDomainId: params.DnsDomainId,
NodesAutoSync: params.NodesAutoSync,
ServersAutoSync: params.ServersAutoSync,
CnameRecords: params.CnameRecords,
})
if err != nil {
this.ErrorPage(err)

View File

@@ -61,6 +61,12 @@ func (this *ClusterAction) RunGet(params struct {
dnsMap["providerTypeName"] = dnsResp.Provider.TypeName
}
if len(dnsResp.CnameRecords) > 0 {
dnsMap["cnameRecords"] = dnsResp.CnameRecords
} else {
dnsMap["cnameRecords"] = []string{}
}
this.Data["dnsInfo"] = dnsMap
// 节点DNS解析记录

View File

@@ -46,6 +46,12 @@ func (this *UpdateClusterPopupAction) RunGet(params struct {
this.Data["providerId"] = 0
}
if len(dnsResp.CnameRecords) == 0 {
this.Data["cnameRecords"] = []string{}
} else {
this.Data["cnameRecords"] = dnsResp.CnameRecords
}
// 所有服务商
providerTypesResp, err := this.RPC().DNSProviderRPC().FindAllDNSProviderTypes(this.AdminContext(), &pb.FindAllDNSProviderTypesRequest{})
if err != nil {
@@ -70,6 +76,7 @@ func (this *UpdateClusterPopupAction) RunPost(params struct {
DomainId int64
NodesAutoSync bool
ServersAutoSync bool
CnameRecords []string
Must *actions.Must
CSRF *actionutils.CSRF
@@ -103,6 +110,7 @@ func (this *UpdateClusterPopupAction) RunPost(params struct {
DnsDomainId: params.DomainId,
NodesAutoSync: params.NodesAutoSync,
ServersAutoSync: params.ServersAutoSync,
CnameRecords: params.CnameRecords,
})
if err != nil {
this.ErrorPage(err)