|
@@ -134,34 +134,36 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"],
|
|
|
}
|
|
|
|
|
|
function showStatImg(o, nodeId) {
|
|
|
- return function (el) {
|
|
|
- var content, caption
|
|
|
+ var content, caption
|
|
|
+
|
|
|
+ if (o.thumbnail) {
|
|
|
+ content = document.createElement("img")
|
|
|
+ content.src = o.thumbnail.replace("{NODE_ID}", nodeId)
|
|
|
+ }
|
|
|
|
|
|
- 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 (o.caption) {
|
|
|
- caption = o.caption.replace("{NODE_ID}", nodeId)
|
|
|
+ if (!content)
|
|
|
+ content = document.createTextNode(caption)
|
|
|
+ }
|
|
|
|
|
|
- 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 (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
|
|
|
+ if (caption && o.thumbnail)
|
|
|
+ link.title = caption
|
|
|
|
|
|
- el.appendChild(link)
|
|
|
- } else
|
|
|
- el.appendChild(content)
|
|
|
- }
|
|
|
+ p.appendChild(link)
|
|
|
+ } else
|
|
|
+ p.appendChild(content)
|
|
|
+
|
|
|
+ return p
|
|
|
}
|
|
|
|
|
|
return function(config, el, router, d) {
|
|
@@ -193,13 +195,17 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"],
|
|
|
attributeEntry(attributes, "Autom. Updates", showAutoupdate(d))
|
|
|
attributeEntry(attributes, "Clients", showClients(d))
|
|
|
|
|
|
+ el.appendChild(attributes)
|
|
|
+
|
|
|
+
|
|
|
if (config.nodeInfos)
|
|
|
config.nodeInfos.forEach( function (nodeInfo) {
|
|
|
- attributeEntry(attributes, nodeInfo.name, showStatImg(nodeInfo, d.nodeinfo.node_id))
|
|
|
+ var h4 = document.createElement("h4")
|
|
|
+ h4.textContent = nodeInfo.name
|
|
|
+ el.appendChild(h4)
|
|
|
+ el.appendChild(showStatImg(nodeInfo, d.nodeinfo.node_id))
|
|
|
})
|
|
|
|
|
|
- el.appendChild(attributes)
|
|
|
-
|
|
|
if (d.neighbours.length > 0) {
|
|
|
var h3 = document.createElement("h3")
|
|
|
h3.textContent = "Nachbarknoten (" + d.neighbours.length + ")"
|