mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2026-04-19 02:05:20 +08:00
优化代码
This commit is contained in:
@@ -43,19 +43,7 @@ func (this *CreatePopupAction) RunGet(params struct{}) {
|
||||
this.Data["paramCustomHTTPSecret"] = rands.HexString(32)
|
||||
|
||||
// EdgeDNS集群列表
|
||||
nsClustersResp, err := this.RPC().NSClusterRPC().FindAllEnabledNSClusters(this.AdminContext(), &pb.FindAllEnabledNSClustersRequest{})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
nsClusterMaps := []maps.Map{}
|
||||
for _, nsCluster := range nsClustersResp.NsClusters {
|
||||
nsClusterMaps = append(nsClusterMaps, maps.Map{
|
||||
"id": nsCluster.Id,
|
||||
"name": nsCluster.Name,
|
||||
})
|
||||
}
|
||||
this.Data["nsClusters"] = nsClusterMaps
|
||||
this.Data["nsClusters"] = []maps.Map{}
|
||||
|
||||
this.Show()
|
||||
}
|
||||
@@ -82,9 +70,6 @@ func (this *CreatePopupAction) RunPost(params struct {
|
||||
ParamCloudFlareAPIKey string
|
||||
ParamCloudFlareEmail string
|
||||
|
||||
// Local EdgeDNS
|
||||
ParamLocalEdgeDNSClusterId int64
|
||||
|
||||
// CustomHTTP
|
||||
ParamCustomHTTPURL string
|
||||
ParamCustomHTTPSecret string
|
||||
@@ -137,11 +122,6 @@ func (this *CreatePopupAction) RunPost(params struct {
|
||||
Email("请输入正确格式的邮箱地址")
|
||||
apiParams["apiKey"] = params.ParamCloudFlareAPIKey
|
||||
apiParams["email"] = params.ParamCloudFlareEmail
|
||||
case "localEdgeDNS":
|
||||
params.Must.
|
||||
Field("ParamLocalEdgeDNSClusterId", params.ParamLocalEdgeDNSClusterId).
|
||||
Gt(0, "请选择域名服务集群")
|
||||
apiParams["clusterId"] = params.ParamLocalEdgeDNSClusterId
|
||||
case "customHTTP":
|
||||
params.Must.
|
||||
Field("paramCustomHTTPURL", params.ParamCustomHTTPURL).
|
||||
|
||||
Reference in New Issue
Block a user