mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-12 16:14:37 +08:00
NET-1986: Only report online hosts and external clients (#3375)
* feat(go): only report online hosts. * feat(go): only report online external clients. * feat(go): only report online hosts and external clients.
This commit is contained in:
parent
fb1052e6a5
commit
4c14cfd099
2 changed files with 3 additions and 2 deletions
|
@ -82,11 +82,11 @@ func getUsage(w http.ResponseWriter, _ *http.Request) {
|
|||
FailOvers int `json:"fail_overs"`
|
||||
}
|
||||
var serverUsage usage
|
||||
hosts, err := logic.GetAllHosts()
|
||||
hosts, err := logic.GetAllHostsWithStatus(models.OnlineSt)
|
||||
if err == nil {
|
||||
serverUsage.Hosts = len(hosts)
|
||||
}
|
||||
clients, err := logic.GetAllExtClients()
|
||||
clients, err := logic.GetAllExtClientsWithStatus(models.OnlineSt)
|
||||
if err == nil {
|
||||
serverUsage.Clients = len(clients)
|
||||
}
|
||||
|
|
|
@ -119,6 +119,7 @@ func GetAllHostsWithStatus(status models.NodeStatus) ([]models.Host, error) {
|
|||
if len(host.Nodes) == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
nodes := GetHostNodes(&host)
|
||||
for _, node := range nodes {
|
||||
getNodeStatus(&node, false)
|
||||
|
|
Loading…
Add table
Reference in a new issue