statistics: re-add "Gateway-Feature"

revert commit c13e648cc6.
This commit is contained in:
PetaByteBoy 2015-11-06 21:10:43 +01:00 committed by Milan Pässler
commit 80afc7d162
3 changed files with 26 additions and 2 deletions

View file

@ -11,6 +11,9 @@ define(function () {
var totalClients = sum(d.nodes.all.filter(online).map( function (d) {
return d.statistics.clients
}))
var totalGateways = sum(d.nodes.all.filter(online).filter( function (d) {
return d.flags.gateway
}).map(one))
var nodetext = [{ count: totalOnlineNodes, label: "online" },
{ count: totalNewNodes, label: "neu" },
@ -20,8 +23,9 @@ define(function () {
.join(", ")
stats.textContent = totalNodes + " Knoten " +
"(" + nodetext + ") mit " +
totalClients + " Client" + ( totalClients === 1 ? "" : "s" )
"(" + nodetext + "), " +
totalClients + " Client" + ( totalClients === 1 ? ", " : "s, " ) +
totalGateways + " Gateways"
timestamp.textContent = "Diese Daten sind von " + d.timestamp.format("LLLL") + "."
}