Pārlūkot izejas kodu

feat(NET-805): send internet gw props to rac

the_aceix 1 gadu atpakaļ
vecāks
revīzija
52b45a878e
2 mainītis faili ar 16 papildinājumiem un 13 dzēšanām
  1. 6 5
      models/structs.go
  2. 10 8
      pro/controllers/users.go

+ 6 - 5
models/structs.go

@@ -64,11 +64,12 @@ type IngressGwUsers struct {
 
 
 // UserRemoteGws - struct to hold user's remote gws
 // UserRemoteGws - struct to hold user's remote gws
 type UserRemoteGws struct {
 type UserRemoteGws struct {
-	GwID      string    `json:"remote_access_gw_id"`
-	GWName    string    `json:"gw_name"`
-	Network   string    `json:"network"`
-	Connected bool      `json:"connected"`
-	GwClient  ExtClient `json:"gw_client"`
+	GwID              string    `json:"remote_access_gw_id"`
+	GWName            string    `json:"gw_name"`
+	Network           string    `json:"network"`
+	Connected         bool      `json:"connected"`
+	IsInternetGateway bool      `json:"is_internet_gateway"`
+	GwClient          ExtClient `json:"gw_client"`
 }
 }
 
 
 // UserRemoteGwsReq - struct to hold user remote acccess gws req
 // UserRemoteGwsReq - struct to hold user remote acccess gws req

+ 10 - 8
pro/controllers/users.go

@@ -197,11 +197,12 @@ func getUserRemoteAccessGws(w http.ResponseWriter, r *http.Request) {
 				gws := userGws[node.Network]
 				gws := userGws[node.Network]
 
 
 				gws = append(gws, models.UserRemoteGws{
 				gws = append(gws, models.UserRemoteGws{
-					GwID:      node.ID.String(),
-					GWName:    host.Name,
-					Network:   node.Network,
-					GwClient:  extClient,
-					Connected: true,
+					GwID:              node.ID.String(),
+					GWName:            host.Name,
+					Network:           node.Network,
+					GwClient:          extClient,
+					Connected:         true,
+					IsInternetGateway: node.IsInternetGateway,
 				})
 				})
 				userGws[node.Network] = gws
 				userGws[node.Network] = gws
 				delete(user.RemoteGwIDs, node.ID.String())
 				delete(user.RemoteGwIDs, node.ID.String())
@@ -230,9 +231,10 @@ func getUserRemoteAccessGws(w http.ResponseWriter, r *http.Request) {
 		gws := userGws[node.Network]
 		gws := userGws[node.Network]
 
 
 		gws = append(gws, models.UserRemoteGws{
 		gws = append(gws, models.UserRemoteGws{
-			GwID:    node.ID.String(),
-			GWName:  host.Name,
-			Network: node.Network,
+			GwID:              node.ID.String(),
+			GWName:            host.Name,
+			Network:           node.Network,
+			IsInternetGateway: node.IsInternetGateway,
 		})
 		})
 		userGws[node.Network] = gws
 		userGws[node.Network] = gws
 	}
 	}