From 1e74f319ef54f8a2088f6d4db729681a98b9b494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20P=C3=A4ssler?= Date: Mon, 28 Dec 2015 18:06:20 +0100 Subject: [PATCH] statistics: uplink statistics --- lib/proportions.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/proportions.js b/lib/proportions.js index d9df65e..322438b 100644 --- a/lib/proportions.js +++ b/lib/proportions.js @@ -20,6 +20,9 @@ define(["chroma-js", "virtual-dom", "numeral-intl", "filters/genericnode", "verc var autoTable = document.createElement("table") autoTable.classList.add("proportion") + var uplinkTable = document.createElement("table") + uplinkTable.classList.add("proportion") + function showStatGlobal(o) { var content, caption @@ -138,12 +141,16 @@ define(["chroma-js", "virtual-dom", "numeral-intl", "filters/genericnode", "verc else return "(deaktiviert)" }) + var uplinkDict = count(nodes, ["flags", "uplink"], function (d) { + return d ? "ja" : "nein" + }) 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] })) } self.render = function (el) { @@ -173,6 +180,11 @@ define(["chroma-js", "virtual-dom", "numeral-intl", "filters/genericnode", "verc el.appendChild(h2) el.appendChild(autoTable) + h2 = document.createElement("h2") + h2.textContent = "Uplink" + el.appendChild(h2) + el.appendChild(uplinkTable) + if (config.globalInfos) config.globalInfos.forEach( function (globalInfo) { h2 = document.createElement("h2")