From 28bd5b890b401f3d4c8cf642d21773f6449cf8d1 Mon Sep 17 00:00:00 2001 From: abhishek9686 Date: Thu, 12 Dec 2024 10:57:06 +0400 Subject: [PATCH] add network name to common node --- controllers/node.go | 2 ++ models/node.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/controllers/node.go b/controllers/node.go index 904f6375b..11d439e28 100644 --- a/controllers/node.go +++ b/controllers/node.go @@ -430,6 +430,8 @@ func getNode(w http.ResponseWriter, r *http.Request) { logic.ReturnErrorResponse(w, r, logic.FormatError(err, "internal")) return } + net, _ := logic.GetNetwork(node.Network) + node.NetworkName = net.Name server := servercfg.GetServerInfo() response := models.NodeGet{ Node: node, diff --git a/models/node.go b/models/node.go index af52c9c4f..c48155964 100644 --- a/models/node.go +++ b/models/node.go @@ -68,7 +68,7 @@ type CommonNode struct { ID uuid.UUID `json:"id" yaml:"id"` HostID uuid.UUID `json:"hostid" yaml:"hostid"` Network string `json:"network" yaml:"network"` - NetworkName string `json:"network_name" yaml:"network_name"` + NetworkName string `json:"network_name" yaml:"network_name"` NetworkRange net.IPNet `json:"networkrange" yaml:"networkrange" swaggertype:"primitive,integer"` NetworkRange6 net.IPNet `json:"networkrange6" yaml:"networkrange6" swaggertype:"primitive,number"` Server string `json:"server" yaml:"server"`