Merge branch 'master' into prometheus-charts
This commit is contained in:
commit
e685fe385f
8 changed files with 186 additions and 154 deletions
|
@ -1,35 +1,9 @@
|
|||
define(function () {
|
||||
function showStatImg(o, source, target) {
|
||||
var content, caption
|
||||
|
||||
if (o.thumbnail) {
|
||||
content = document.createElement("img")
|
||||
content.src = o.thumbnail.replace("{SOURCE}", source).replace("{TARGET}", target)
|
||||
}
|
||||
|
||||
if (o.caption) {
|
||||
caption = o.caption.replace("{SOURCE}", source).replace("{TARGET}", target)
|
||||
|
||||
if (!content)
|
||||
content = document.createTextNode(caption)
|
||||
}
|
||||
|
||||
var p = document.createElement("p")
|
||||
|
||||
if (o.href) {
|
||||
var link = document.createElement("a")
|
||||
link.target = "_blank"
|
||||
link.href = o.href.replace("{SOURCE}", source).replace("{TARGET}", target)
|
||||
link.appendChild(content)
|
||||
|
||||
if (caption && o.thumbnail)
|
||||
link.title = caption
|
||||
|
||||
p.appendChild(link)
|
||||
} else
|
||||
p.appendChild(content)
|
||||
|
||||
return p
|
||||
var subst = {}
|
||||
subst["{SOURCE}"] = source
|
||||
subst["{TARGET}"] = target
|
||||
return showStat(o, subst)
|
||||
}
|
||||
|
||||
return function (config, el, router, d) {
|
||||
|
|
|
@ -219,37 +219,11 @@ define(["moment", "numeral", "tablesort", "infobox/charts", "tablesort.numeric"]
|
|||
return au.enabled ? "aktiviert (" + au.branch + ")" : "deaktiviert"
|
||||
}
|
||||
|
||||
function showStatImg(o, nodeId) {
|
||||
var content, caption
|
||||
|
||||
if (o.thumbnail) {
|
||||
content = document.createElement("img")
|
||||
content.src = o.thumbnail.replace("{NODE_ID}", nodeId)
|
||||
}
|
||||
|
||||
if (o.caption) {
|
||||
caption = o.caption.replace("{NODE_ID}", nodeId)
|
||||
|
||||
if (!content)
|
||||
content = document.createTextNode(caption)
|
||||
}
|
||||
|
||||
var p = document.createElement("p")
|
||||
|
||||
if (o.href) {
|
||||
var link = document.createElement("a")
|
||||
link.target = "_blank"
|
||||
link.href = o.href.replace("{NODE_ID}", nodeId)
|
||||
link.appendChild(content)
|
||||
|
||||
if (caption && o.thumbnail)
|
||||
link.title = caption
|
||||
|
||||
p.appendChild(link)
|
||||
} else
|
||||
p.appendChild(content)
|
||||
|
||||
return p
|
||||
function showStatImg(o, d) {
|
||||
var subst = {}
|
||||
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 function(config, el, router, d) {
|
||||
|
@ -294,7 +268,7 @@ define(["moment", "numeral", "tablesort", "infobox/charts", "tablesort.numeric"]
|
|||
var h4 = document.createElement("h4")
|
||||
h4.textContent = nodeInfo.name
|
||||
el.appendChild(h4)
|
||||
el.appendChild(showStatImg(nodeInfo, d.nodeinfo.node_id))
|
||||
el.appendChild(showStatImg(nodeInfo, d))
|
||||
})
|
||||
|
||||
if (d.neighbours.length > 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue