meshstats: dynamic gateway count
This commit is contained in:
parent
1bcd2b797d
commit
93355f28ba
|
@ -4,9 +4,8 @@ define([], function () {
|
||||||
var n = Object.create(data)
|
var n = Object.create(data)
|
||||||
n.nodes = {}
|
n.nodes = {}
|
||||||
|
|
||||||
for (var key in data.nodes) {
|
for (var key in data.nodes)
|
||||||
n.nodes[key] = data.nodes[key].filter(filter)
|
n.nodes[key] = data.nodes[key].filter(filter)
|
||||||
}
|
|
||||||
|
|
||||||
var filteredIds = new Set()
|
var filteredIds = new Set()
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,11 @@ define(function () {
|
||||||
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 ? d.statistics.clients : 0
|
return d.statistics.clients ? d.statistics.clients : 0
|
||||||
}))
|
}))
|
||||||
var totalGateways = sum(d.nodes.all.filter(online).filter( function (d) {
|
var totalGateways = sum(Array.from(new Set(d.nodes.all.filter(online).map( function(d) {
|
||||||
|
return d.statistics.gateway
|
||||||
|
}).concat(d.nodes.all.filter( function (d) {
|
||||||
return d.flags.gateway
|
return d.flags.gateway
|
||||||
}).map(one))
|
})))).map(one))
|
||||||
|
|
||||||
var nodetext = [{ count: totalOnlineNodes, label: "online" },
|
var nodetext = [{ count: totalOnlineNodes, label: "online" },
|
||||||
{ count: totalNewNodes, label: "neu" },
|
{ count: totalNewNodes, label: "neu" },
|
||||||
|
|
Loading…
Reference in a new issue