[BUGFIX] fix calculation of wifi clients

(#106)
This commit is contained in:
kb-light 2017-12-28 11:55:47 +01:00 committed by Martin Geno
parent 62bb21102f
commit 8fffdac0a4
No known key found for this signature in database
GPG Key ID: F0D39A37E925E941
1 changed files with 5 additions and 6 deletions

View File

@ -106,15 +106,14 @@ func NewNode(nodes *runtime.Nodes, n *runtime.Node) *Node {
} }
if statistic := n.Statistics; statistic != nil { if statistic := n.Statistics; statistic != nil {
node.Clients = statistic.Clients.Total node.Clients = statistic.Clients.Total
if node.Clients == 0 {
node.Clients = statistic.Clients.Wifi24 + statistic.Clients.Wifi5
}
node.ClientsWifi24 = statistic.Clients.Wifi24 node.ClientsWifi24 = statistic.Clients.Wifi24
node.ClientsWifi5 = statistic.Clients.Wifi5 node.ClientsWifi5 = statistic.Clients.Wifi5
wifi := node.ClientsWifi24 - node.ClientsWifi5 clientsWifi := node.ClientsWifi24 + node.ClientsWifi5
if node.Clients >= wifi { if node.Clients == 0 {
node.ClientsOthers = node.Clients - wifi node.Clients = clientsWifi
} else if node.Clients >= clientsWifi {
node.ClientsOthers = node.Clients - clientsWifi
} }
node.RootFSUsage = statistic.RootFsUsage node.RootFSUsage = statistic.RootFsUsage