infobox/node: nodeinfos {NODE_NAME} support

This commit is contained in:
Milan Pässler 2016-03-28 22:58:45 +02:00
parent 1f07f50530
commit 08e00d4b91

View File

@ -219,9 +219,10 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"],
return au.enabled ? "aktiviert (" + au.branch + ")" : "deaktiviert" return au.enabled ? "aktiviert (" + au.branch + ")" : "deaktiviert"
} }
function showStatImg(o, nodeId) { function showStatImg(o, d) {
var subst = {} var subst = {}
subst["{NODE_ID}"] = nodeId subst["{NODE_ID}"] = d.nodeinfo.node_id ? d.nodeinfo.node_id : "unknown"
subst["{NODE_NAME}"] = d.nodeinfo.hostname ? d.nodeinfo.hostname : "unknown"
return showStat(o, subst) return showStat(o, subst)
} }
@ -263,7 +264,7 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"],
var h4 = document.createElement("h4") var h4 = document.createElement("h4")
h4.textContent = nodeInfo.name h4.textContent = nodeInfo.name
el.appendChild(h4) el.appendChild(h4)
el.appendChild(showStatImg(nodeInfo, d.nodeinfo.node_id)) el.appendChild(showStatImg(nodeInfo, d))
}) })
if (d.neighbours.length > 0) { if (d.neighbours.length > 0) {