diff --git a/lib/infobox/node.js b/lib/infobox/node.js index fa34b0f..b1af9a9 100644 --- a/lib/infobox/node.js +++ b/lib/infobox/node.js @@ -177,6 +177,37 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"], } } + function showPages(d) { + var webpages = dictGet(d.nodeinfo, ["pages"]) + if (webpages === null) + return undefined + + webpages.sort() + + return function (el) { + webpages.forEach( function (webpage, i) { + if (i > 0) + el.appendChild(document.createElement("br")) + + var a = document.createElement("span") + var link = document.createElement("a") + link.href = webpage + if (webpage.search(/^https:\/\//i) !== -1) { + var lock = document.createElement("span") + lock.className = "ion-android-lock" + a.appendChild(lock) + var t1 = document.createTextNode(" ") + a.appendChild(t1) + link.textContent = webpage.replace(/^https:\/\//i, "") + } + else + link.textContent = webpage.replace(/^http:\/\//i, "") + a.appendChild(link) + el.appendChild(a) + }) + } + } + function showAutoupdate(d) { var au = dictGet(d.nodeinfo, ["software", "autoupdater"]) if (!au) @@ -243,6 +274,7 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"], attributeEntry(attributes, "Load - avg", showLOAD(d)) attributeEntry(attributes, "Arbeitsspeicher", showRAM(d)) attributeEntry(attributes, "IP Adressen", showIPs(d)) + attributeEntry(attributes, "Webseite", showPages(d)) attributeEntry(attributes, "Gewähltes Gateway", dictGet(d.statistics, ["gateway"])) attributeEntry(attributes, "Autom. Updates", showAutoupdate(d)) attributeEntry(attributes, "Clients", showClients(d))