meshstats: count and show all nodes (online and offline)

This commit is contained in:
kokel 2015-06-04 14:36:59 +02:00
parent ec0965645f
commit ae931347be

View file

@ -4,7 +4,8 @@ define(function () {
var stats, timestamp var stats, timestamp
self.setData = function (d) { self.setData = function (d) {
var totalNodes = sum(d.nodes.all.filter(online).map(one)) var totalNodes = sum(d.nodes.all.map(one))
var totalOnlineNodes = sum(d.nodes.all.filter(online).map(one))
var totalClients = sum(d.nodes.all.filter(online).map( function (d) { var totalClients = sum(d.nodes.all.filter(online).map( function (d) {
return d.statistics.clients return d.statistics.clients
})) }))
@ -12,7 +13,8 @@ define(function () {
return d.flags.gateway return d.flags.gateway
}).map(one)) }).map(one))
stats.textContent = totalNodes + " Knoten (online), " + stats.textContent = "Insgesamt " + totalNodes + " Knoten, " +
"davon " + totalOnlineNodes + " online, " +
totalClients + " Clients, " + totalClients + " Clients, " +
totalGateways + " Gateways" totalGateways + " Gateways"