From 2da97bca161551d130e46d27245b4a4dd1afc77d Mon Sep 17 00:00:00 2001 From: Moritz Date: Fri, 3 Jun 2016 00:43:08 +0200 Subject: [PATCH] meshstats: show offline nodes (#39) --- lib/meshstats.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/meshstats.js b/lib/meshstats.js index 96d19fd..b10f7c4 100644 --- a/lib/meshstats.js +++ b/lib/meshstats.js @@ -6,6 +6,7 @@ define(function () { self.setData = function (d) { var totalNodes = sum(d.nodes.all.map(one)) var totalOnlineNodes = sum(d.nodes.all.filter(online).map(one)) + var totalOfflineNodes = sum(d.nodes.all.filter(function (node) {return !node.flags.online}).map(one)) var totalNewNodes = sum(d.nodes.new.map(one)) var totalLostNodes = sum(d.nodes.lost.map(one)) var totalClients = sum(d.nodes.all.filter(online).map( function (d) { @@ -20,6 +21,7 @@ define(function () { })) var nodetext = [{ count: totalOnlineNodes, label: "online" }, + { count: totalOfflineNodes, label: "offline" }, { count: totalNewNodes, label: "neu" }, { count: totalLostNodes, label: "verschwunden" } ].filter( function (d) { return d.count > 0 } )