statistics: re-add "Gateway-Feature"

revert commit c13e648cc6.
This commit is contained in:
PetaByteBoy 2015-11-06 21:10:43 +01:00 committed by Milan Pässler
commit 80afc7d162
3 changed files with 26 additions and 2 deletions

View file

@ -23,6 +23,9 @@ define(["chroma-js", "virtual-dom", "numeral-intl", "filters/genericnode", "verc
var uplinkTable = document.createElement("table")
uplinkTable.classList.add("proportion")
var gwTable = document.createElement("table")
gwTable.classList.add("proportion")
function showStatGlobal(o) {
var content, caption
@ -145,12 +148,23 @@ define(["chroma-js", "virtual-dom", "numeral-intl", "filters/genericnode", "verc
return d ? "ja" : "nein"
})
var gwDict = count(nodes, ["statistics", "gateway"], function (d) {
if (d === null)
return null
if (d in nodeDict)
return nodeDict[d].nodeinfo.hostname
return d
})
fillTable("Status", statusTable, statusDict.sort(function (a, b) { return b[1] - a[1] }))
fillTable("Firmware", fwTable, fwDict.sort(function (a, b) { return vercomp(b[0], a[0]) }))
fillTable("Hardware", hwTable, hwDict.sort(function (a, b) { return b[1] - a[1] }))
fillTable("Koordinaten", geoTable, geoDict.sort(function (a, b) { return b[1] - a[1] }))
fillTable("Autom. Updates", autoTable, autoDict.sort(function (a, b) { return b[1] - a[1] }))
fillTable("Uplink", uplinkTable, uplinkDict.sort(function (a, b) { return b[1] - a[1] }))
fillTable("Gewähltes Gateway", gwTable, gwDict.sort(function (a, b) { return b[1] - a[1] }))
}
self.render = function (el) {
@ -185,6 +199,11 @@ define(["chroma-js", "virtual-dom", "numeral-intl", "filters/genericnode", "verc
el.appendChild(h2)
el.appendChild(uplinkTable)
h2 = document.createElement("h2")
h2.textContent = "Gewählter Gateway"
el.appendChild(h2)
el.appendChild(gwTable)
if (config.globalInfos)
config.globalInfos.forEach( function (globalInfo) {
h2 = document.createElement("h2")