refactor setData
This commit is contained in:
parent
3e143435e6
commit
a031ac336d
7 changed files with 47 additions and 35 deletions
|
|
@ -3,12 +3,12 @@ define(["moment"], function (moment) {
|
|||
var self = this
|
||||
var p
|
||||
|
||||
self.setData = function (nodes) {
|
||||
var totalNodes = sum(nodes.filter(online).map(one))
|
||||
var totalClients = sum(nodes.filter(online).map( function (d) {
|
||||
self.setData = function (d) {
|
||||
var totalNodes = sum(d.nodes.all.filter(online).map(one))
|
||||
var totalClients = sum(d.nodes.all.filter(online).map( function (d) {
|
||||
return d.statistics.clients
|
||||
}))
|
||||
var totalGateways = sum(nodes.filter(online).filter( function (d) {
|
||||
var totalGateways = sum(d.nodes.all.filter(online).filter( function (d) {
|
||||
return d.flags.gateway
|
||||
}).map(one))
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ define(["moment"], function (moment) {
|
|||
totalGateways + " Gateways"
|
||||
|
||||
p.appendChild(document.createElement("br"))
|
||||
p.appendChild(document.createTextNode("Diese Daten sind von " + moment(nodes.timestamp).format("LLLL") + "."))
|
||||
p.appendChild(document.createTextNode("Diese Daten sind von " + moment(d.timestamp).format("LLLL") + "."))
|
||||
}
|
||||
|
||||
self.render = function (el) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue