Browse Source

add relay field to api to host model conversion

Abhishek Kondur 2 years ago
parent
commit
0a5a48f80b
1 changed files with 4 additions and 1 deletions
  1. 4 1
      models/api_host.go

+ 4 - 1
models/api_host.go

@@ -96,7 +96,10 @@ func (a *ApiHost) ConvertAPIHostToNMHost(currentHost *Host) *Host {
 	h.Nodes = currentHost.Nodes
 	h.Nodes = currentHost.Nodes
 	h.TrafficKeyPublic = currentHost.TrafficKeyPublic
 	h.TrafficKeyPublic = currentHost.TrafficKeyPublic
 	h.OS = currentHost.OS
 	h.OS = currentHost.OS
-
+	h.RelayedBy = a.RelayedBy
+	h.RelayedHosts = a.RelayedHosts
+	h.IsRelay = a.IsRelay
+	h.IsRelayed = a.IsRelayed
 	if len(a.LocalRange) > 0 {
 	if len(a.LocalRange) > 0 {
 		_, localRange, err := net.ParseCIDR(a.LocalRange)
 		_, localRange, err := net.ParseCIDR(a.LocalRange)
 		if err == nil {
 		if err == nil {