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

@ -123,6 +123,15 @@ function (moment, Router, L, GUI, numeral) {
nodes.forEach( function (d) {
d.neighbours = []
if (d.statistics) {
/*eslint camelcase:0*/
if ("gateway" in d.statistics && d.statistics.gateway in graphnodes)
d.statistics.gateway = {"node": graphnodes[d.statistics.gateway], "id": d.statistics.gateway}
if ("nexthop" in d.statistics && d.statistics.nexthop in graphnodes)
d.statistics.nexthop = {"node": graphnodes[d.statistics.nexthop], "id": d.statistics.nexthop}
if ("gateway_nexthop" in d.statistics && d.statistics.gateway_nexthop in graphnodes)
d.statistics.gateway_nexthop = {"node": graphnodes[d.statistics.gateway_nexthop], "id": d.statistics.gateway_nexthop}
}
})
links.forEach( function (d) {