mirror of
https://github.com/gravitl/netmaker.git
synced 2025-11-01 04:32:40 +08:00
fix(GRA-752f): add address string to be sent to frontend
This commit is contained in:
@@ -48,8 +48,9 @@ type NodeCheckin struct {
|
|||||||
|
|
||||||
// Iface struct for local interfaces of a node
|
// Iface struct for local interfaces of a node
|
||||||
type Iface struct {
|
type Iface struct {
|
||||||
Name string
|
Name string `json:"name"`
|
||||||
Address net.IPNet
|
Address net.IPNet `json:"address"`
|
||||||
|
AddressString string `json:"addressString"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Node - struct for node model
|
// Node - struct for node model
|
||||||
|
|||||||
@@ -53,6 +53,9 @@ func Ping(client mqtt.Client, msg mqtt.Message) {
|
|||||||
node.Version = checkin.Version
|
node.Version = checkin.Version
|
||||||
node.Connected = checkin.Connected
|
node.Connected = checkin.Connected
|
||||||
node.Interfaces = checkin.Ifaces
|
node.Interfaces = checkin.Ifaces
|
||||||
|
for i := range node.Interfaces {
|
||||||
|
node.Interfaces[i].AddressString = node.Interfaces[i].Address.String()
|
||||||
|
}
|
||||||
if err := logic.UpdateNode(&node, &node); err != nil {
|
if err := logic.UpdateNode(&node, &node); err != nil {
|
||||||
logger.Log(0, "error updating node", node.Name, node.ID, " on checkin", err.Error())
|
logger.Log(0, "error updating node", node.Name, node.ID, " on checkin", err.Error())
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user