Browse Source

Merge pull request #15 from freifunk-mwu/nodecounts

meshstats: count and show all nodes (online and offline)
Nils Schneider 9 years ago
parent
commit
15e3f41183
1 changed files with 4 additions and 2 deletions
  1. 4 2
      lib/meshstats.js

+ 4 - 2
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"