节点IP显示原始IP(如果已经切换到备用IP的话)

This commit is contained in:
GoEdgeLab
2021-12-16 15:18:21 +08:00
parent 77d62d9ef0
commit d404db7011
3 changed files with 18 additions and 0 deletions

View File

@@ -86,9 +86,16 @@ func (this *DetailAction) RunGet(params struct {
return
}
// 是否有备用IP
var originIP = addr.Ip
if len(addr.BackupIP) > 0 {
addr.Ip = addr.BackupIP
}
ipAddressMaps = append(ipAddressMaps, maps.Map{
"id": addr.Id,
"name": addr.Name,
"originIP": originIP,
"ip": addr.Ip,
"canAccess": addr.CanAccess,
"isOn": addr.IsOn,

View File

@@ -94,6 +94,16 @@ func UpdateNodeIPAddresses(parentAction *actionutils.ParentAction, nodeId int64,
return err
}
}
} else {
for _, addrId := range resultAddrIds {
_, err = parentAction.RPC().NodeIPAddressThresholdRPC().UpdateAllNodeIPAddressThresholds(parentAction.AdminContext(), &pb.UpdateAllNodeIPAddressThresholdsRequest{
NodeIPAddressId: addrId,
NodeIPAddressThresholdsJSON: []byte("[]"),
})
if err != nil {
return err
}
}
}
}
return nil