mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 05:00:25 +08:00 
			
		
		
		
	节点IP增加是否启用、是否在线状态
This commit is contained in:
		@@ -18,11 +18,18 @@ func UpdateNodeIPAddresses(parentAction *actionutils.ParentAction, nodeId int64,
 | 
			
		||||
	for _, addr := range addresses {
 | 
			
		||||
		addrId := addr.GetInt64("id")
 | 
			
		||||
		if addrId > 0 {
 | 
			
		||||
			var isOn = false
 | 
			
		||||
			if !addr.Has("isOn") { // 兼容老版本
 | 
			
		||||
				isOn = true
 | 
			
		||||
			} else {
 | 
			
		||||
				isOn = addr.GetBool("isOn")
 | 
			
		||||
			}
 | 
			
		||||
			_, err = parentAction.RPC().NodeIPAddressRPC().UpdateNodeIPAddress(parentAction.AdminContext(), &pb.UpdateNodeIPAddressRequest{
 | 
			
		||||
				AddressId: addrId,
 | 
			
		||||
				Ip:        addr.GetString("ip"),
 | 
			
		||||
				Name:      addr.GetString("name"),
 | 
			
		||||
				CanAccess: addr.GetBool("canAccess"),
 | 
			
		||||
				IsOn:      isOn,
 | 
			
		||||
			})
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return err
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user