infobox/node: change mac used to lookup nodes
This commit is contained in:
parent
0171ebe7e1
commit
2ca2604403
|
@ -34,11 +34,6 @@ define(["filters/nodefilter"], function (NodeFilter) {
|
||||||
|
|
||||||
filteredData = new NodeFilter(filter)(data)
|
filteredData = new NodeFilter(filter)(data)
|
||||||
|
|
||||||
filteredData.nodeDict = {}
|
|
||||||
filteredData.nodes.all.forEach(function (d) {
|
|
||||||
filteredData.nodeDict[dictGet(d, ["nodeinfo", "network", "mac"]).substr(9)] = d
|
|
||||||
})
|
|
||||||
|
|
||||||
targets.forEach( function (t) {
|
targets.forEach( function (t) {
|
||||||
t.setData(filteredData)
|
t.setData(filteredData)
|
||||||
})
|
})
|
||||||
|
|
|
@ -48,7 +48,11 @@ define(["infobox/link", "infobox/node", "infobox/location"], function (Link, Nod
|
||||||
}
|
}
|
||||||
|
|
||||||
self.setData = function (d) {
|
self.setData = function (d) {
|
||||||
nodeDict = d.nodeDict
|
nodeDict = {}
|
||||||
|
d.graph.nodes.forEach(function (d) {
|
||||||
|
nodeDict[d.id.substr(0, 8)] = d
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
|
@ -317,11 +317,11 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"],
|
||||||
if (!d)
|
if (!d)
|
||||||
return null
|
return null
|
||||||
|
|
||||||
var node = nodeDict[d.substr(9)]
|
var node = nodeDict[d.substr(0, 8)]
|
||||||
if (!node)
|
if (!node)
|
||||||
return d
|
return d
|
||||||
|
|
||||||
return {node: node}
|
return node
|
||||||
}
|
}
|
||||||
|
|
||||||
function showGateway(d, router, nodeDict) {
|
function showGateway(d, router, nodeDict) {
|
||||||
|
@ -336,10 +336,10 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"],
|
||||||
return function (el) {
|
return function (el) {
|
||||||
if (nh) {
|
if (nh) {
|
||||||
el.appendChild(createLink(lookupNode(nh, nodeDict), router))
|
el.appendChild(createLink(lookupNode(nh, nodeDict), router))
|
||||||
if (nh.substr(9) !== gw.substr(9))
|
if (nh.substr(0, 8) !== gw.substr(0, 8))
|
||||||
el.appendChild(document.createTextNode(" -> ... -> "))
|
el.appendChild(document.createTextNode(" -> ... -> "))
|
||||||
}
|
}
|
||||||
if (!nh || nh.substr(9) !== gw.substr(9))
|
if (!nh || nh.substr(0, 8) !== gw.substr(0, 8))
|
||||||
el.appendChild(createLink(lookupNode(gw, nodeDict), router))
|
el.appendChild(createLink(lookupNode(gw, nodeDict), router))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue