mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 08:47:35 +08:00
NET-1782: Fetch Node Connection Status from metrics (#3237)
* add live status of node * handle static node status * add public IP field to server configuration * get public Ip from config * improve node status logic * improvise status check * use only checkin status on old nodes --------- Co-authored-by: the_aceix <aceixsmartx@gmail.com>
This commit is contained in:
@@ -326,8 +326,9 @@ func getNetworkNodes(w http.ResponseWriter, r *http.Request) {
|
||||
if len(filteredNodes) > 0 {
|
||||
nodes = filteredNodes
|
||||
}
|
||||
nodes = logic.AddStaticNodestoList(nodes)
|
||||
|
||||
nodes = logic.AddStaticNodestoList(nodes)
|
||||
nodes = logic.AddStatusToNodes(nodes)
|
||||
// returns all the nodes in JSON/API format
|
||||
apiNodes := logic.GetAllNodesAPI(nodes[:])
|
||||
logger.Log(2, r.Header.Get("user"), "fetched nodes on network", networkName)
|
||||
@@ -367,6 +368,7 @@ func getAllNodes(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
}
|
||||
nodes = logic.AddStaticNodestoList(nodes)
|
||||
nodes = logic.AddStatusToNodes(nodes)
|
||||
// return all the nodes in JSON/API format
|
||||
apiNodes := logic.GetAllNodesAPI(nodes[:])
|
||||
logger.Log(3, r.Header.Get("user"), "fetched all nodes they have access to")
|
||||
|
Reference in New Issue
Block a user