Fully resolve gateway names in hopglass (#57)

Depends on hopglass/hopglass-server#56
This commit is contained in:
Marvin W 2016-08-05 19:47:25 +02:00 committed by PetaByteBoy // Milan Pässler
commit cb065d8d07
4 changed files with 48 additions and 23 deletions

View file

@ -13,7 +13,7 @@ define(function () {
return d.statistics.clients ? d.statistics.clients : 0
}))
var totalGateways = sum(Array.from(new Set(d.nodes.all.filter(online).map( function(d) {
return d.statistics.gateway
return ("gateway" in d.statistics && d.statistics.gateway.id) ? d.statistics.gateway.id : d.statistics.gateway
}).concat(d.nodes.all.filter( function (d) {
return d.flags.gateway
})))).map(function(d) {