mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-10 01:10:29 +08:00
修复当集群没有绑定DNS域名时无法修改节点DNS信息的Bug
This commit is contained in:
@@ -85,10 +85,12 @@ func (this *UpdateDNSPopupAction) RunPost(params struct {
|
|||||||
defer this.CreateLog(oplogs.LevelInfo, "修改节点 %d 的DNS设置", params.NodeId)
|
defer this.CreateLog(oplogs.LevelInfo, "修改节点 %d 的DNS设置", params.NodeId)
|
||||||
|
|
||||||
routes := []string{}
|
routes := []string{}
|
||||||
err := json.Unmarshal(params.DnsRoutesJSON, &routes)
|
if len(params.DnsRoutesJSON) > 0 {
|
||||||
if err != nil {
|
err := json.Unmarshal(params.DnsRoutesJSON, &routes)
|
||||||
this.ErrorPage(err)
|
if err != nil {
|
||||||
return
|
this.ErrorPage(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
params.Must.
|
params.Must.
|
||||||
@@ -100,7 +102,7 @@ func (this *UpdateDNSPopupAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 执行修改
|
// 执行修改
|
||||||
_, err = this.RPC().NodeRPC().UpdateNodeDNS(this.AdminContext(), &pb.UpdateNodeDNSRequest{
|
_, err := this.RPC().NodeRPC().UpdateNodeDNS(this.AdminContext(), &pb.UpdateNodeDNSRequest{
|
||||||
NodeId: params.NodeId,
|
NodeId: params.NodeId,
|
||||||
IpAddr: params.IpAddr,
|
IpAddr: params.IpAddr,
|
||||||
DnsDomainId: params.DomainId,
|
DnsDomainId: params.DomainId,
|
||||||
|
|||||||
@@ -85,10 +85,12 @@ func (this *UpdateNodePopupAction) RunPost(params struct {
|
|||||||
defer this.CreateLog(oplogs.LevelInfo, "修改节点 %d 的DNS设置", params.NodeId)
|
defer this.CreateLog(oplogs.LevelInfo, "修改节点 %d 的DNS设置", params.NodeId)
|
||||||
|
|
||||||
routes := []string{}
|
routes := []string{}
|
||||||
err := json.Unmarshal(params.DnsRoutesJSON, &routes)
|
if len(params.DnsRoutesJSON) > 0 {
|
||||||
if err != nil {
|
err := json.Unmarshal(params.DnsRoutesJSON, &routes)
|
||||||
this.ErrorPage(err)
|
if err != nil {
|
||||||
return
|
this.ErrorPage(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
params.Must.
|
params.Must.
|
||||||
@@ -100,7 +102,7 @@ func (this *UpdateNodePopupAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 执行修改
|
// 执行修改
|
||||||
_, err = this.RPC().NodeRPC().UpdateNodeDNS(this.AdminContext(), &pb.UpdateNodeDNSRequest{
|
_, err := this.RPC().NodeRPC().UpdateNodeDNS(this.AdminContext(), &pb.UpdateNodeDNSRequest{
|
||||||
NodeId: params.NodeId,
|
NodeId: params.NodeId,
|
||||||
IpAddr: params.IpAddr,
|
IpAddr: params.IpAddr,
|
||||||
DnsDomainId: params.DomainId,
|
DnsDomainId: params.DomainId,
|
||||||
|
|||||||
Reference in New Issue
Block a user