From ae931347beea25de6cbf942fa1e2367ca893ac5c Mon Sep 17 00:00:00 2001 From: kokel Date: Thu, 4 Jun 2015 14:36:59 +0200 Subject: [PATCH] meshstats: count and show all nodes (online and offline) --- lib/meshstats.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/meshstats.js b/lib/meshstats.js index c378ffa..b7c7b5e 100644 --- a/lib/meshstats.js +++ b/lib/meshstats.js @@ -4,7 +4,8 @@ define(function () { var stats, timestamp 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) { return d.statistics.clients })) @@ -12,7 +13,8 @@ define(function () { return d.flags.gateway }).map(one)) - stats.textContent = totalNodes + " Knoten (online), " + + stats.textContent = "Insgesamt " + totalNodes + " Knoten, " + + "davon " + totalOnlineNodes + " online, " + totalClients + " Clients, " + totalGateways + " Gateways"