Browse Source

proportions.js: Show selected Site
not tested

Karsten Böddeker 8 years ago
parent
commit
16fb2c883d
1 changed files with 11 additions and 1 deletions
  1. 11 1
      lib/proportions.js

+ 11 - 1
lib/proportions.js

@@ -19,6 +19,9 @@ define(["chroma-js", "virtual-dom", "numeral-intl", "filters/genericnode", "verc
 
     var autoTable = document.createElement("table")
     autoTable.classList.add("proportion")
+    
+    var siteTable = document.createElement("table")
+    siteTable.classList.add("proportion")
 
     function showStatGlobal(o) {
       var content, caption
@@ -138,12 +141,14 @@ define(["chroma-js", "virtual-dom", "numeral-intl", "filters/genericnode", "verc
         else
           return "(deaktiviert)"
       })
+      var siteDict = count(nodes, ["nodeinfo", "system", "site_code"])
 
       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("Site", siteTable, siteDict.sort(function (a, b) { return b[1] - a[1] }))
     }
 
     self.render = function (el) {
@@ -172,6 +177,11 @@ define(["chroma-js", "virtual-dom", "numeral-intl", "filters/genericnode", "verc
       h2.textContent = "Autoupdater"
       el.appendChild(h2)
       el.appendChild(autoTable)
+      
+      h2 = document.createElement("h2")
+      h2.textContent = "Site"
+      el.appendChild(h2)
+      el.appendChild(autoTable)
 
       if (config.globalInfos)
           config.globalInfos.forEach( function (globalInfo) {
@@ -185,4 +195,4 @@ define(["chroma-js", "virtual-dom", "numeral-intl", "filters/genericnode", "verc
 
     return self
   }
-})
+})