infobox/node: resolve nexthop and gateway from data
not perfect yet: the mac address doesn't always match
This commit is contained in:
parent
7d145141c1
commit
9e7049c9e3
4 changed files with 30 additions and 8 deletions
|
@ -2,6 +2,7 @@ define(["infobox/link", "infobox/node", "infobox/location"], function (Link, Nod
|
|||
return function (config, sidebar, router) {
|
||||
var self = this
|
||||
var el
|
||||
var nodeDict
|
||||
|
||||
function destroy() {
|
||||
if (el && el.parentNode) {
|
||||
|
@ -33,7 +34,7 @@ define(["infobox/link", "infobox/node", "infobox/location"], function (Link, Nod
|
|||
|
||||
self.gotoNode = function (d) {
|
||||
create()
|
||||
new Node(config, el, router, d)
|
||||
new Node(config, el, router, d, nodeDict)
|
||||
}
|
||||
|
||||
self.gotoLink = function (d) {
|
||||
|
@ -46,6 +47,10 @@ define(["infobox/link", "infobox/node", "infobox/location"], function (Link, Nod
|
|||
new Location(config, el, router, d)
|
||||
}
|
||||
|
||||
self.setData = function (d) {
|
||||
nodeDict = d.nodeDict
|
||||
}
|
||||
|
||||
return self
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue