优化代码

This commit is contained in:
刘祥超
2022-08-05 14:38:56 +08:00
parent 4e4d9e33f0
commit aa0c38d66f
7 changed files with 31 additions and 128 deletions

View File

@@ -40,21 +40,10 @@ func (this *ProviderAction) RunGet(params struct {
}
// 本地EdgeDNS相关
var localEdgeDNSMap = maps.Map{}
if provider.Type == "localEdgeDNS" {
nsClusterId := apiParams.GetInt64("clusterId")
nsClusterResp, err := this.RPC().NSClusterRPC().FindEnabledNSCluster(this.AdminContext(), &pb.FindEnabledNSClusterRequest{NsClusterId: nsClusterId})
if err != nil {
this.ErrorPage(err)
return
}
nsCluster := nsClusterResp.NsCluster
if nsCluster != nil {
localEdgeDNSMap = maps.Map{
"id": nsCluster.Id,
"name": nsCluster.Name,
}
}
localEdgeDNSMap, err := this.readEdgeDNS(provider, apiParams)
if err != nil {
this.ErrorPage(err)
return
}
this.Data["provider"] = maps.Map{