infobox: handle directional links

This commit is contained in:
Milan Pässler 2016-02-18 16:38:36 +00:00
commit f354a6fbc7
3 changed files with 7 additions and 4 deletions

View file

@ -100,8 +100,8 @@ function (moment, Router, L, GUI, numeral) {
})
links.forEach( function (d) {
d.source.node.neighbours.push({ node: d.target.node, link: d })
d.target.node.neighbours.push({ node: d.source.node, link: d })
d.source.node.neighbours.push({ node: d.target.node, link: d, incoming: false })
d.target.node.neighbours.push({ node: d.source.node, link: d, incoming: true })
if (!d.vpn) {
d.source.node.meshlinks = d.source.node.meshlinks ? d.source.node.meshlinks + 1 : 1
d.target.node.meshlinks = d.target.node.meshlinks ? d.target.node.meshlinks + 1 : 1