do not count nodes own TT link as client

alfred-data
Nils Schneider 2012-06-16 05:01:05 +02:00
parent 4581df14f1
commit 86307665fc
1 changed files with 15 additions and 11 deletions

View File

@ -118,10 +118,10 @@ meshinfo.append("p")
.attr("id", "nodecount") .attr("id", "nodecount")
meshinfo.append("p") meshinfo.append("p")
.attr("id", "clientcount") .attr("id", "gatewaycount")
meshinfo.append("p") meshinfo.append("p")
.attr("id", "gatewaycount") .attr("id", "clientcount")
//cp.append("input") //cp.append("input")
// .on("keyup", function(){show_node(this.value)}) // .on("keyup", function(){show_node(this.value)})
@ -343,20 +343,24 @@ function reload() {
updated_at.text(d3.time.format("%X")(new Date())) updated_at.text(d3.time.format("%X")(new Date()))
d3.select("#nodecount") var nNodes = data.nodes.filter(function(d) {
.text((data.nodes.filter(function(d) {
return !d.flags.client return !d.flags.client
}).length) + " Knoten") }).length,
nGateways = data.nodes.filter(function(d) {
return d.flags.gateway
}).length,
nClients = data.nodes.filter(function(d) {
return d.flags.client
}).length
d3.select("#nodecount")
.text(nNodes + " Knoten")
d3.select("#gatewaycount") d3.select("#gatewaycount")
.text((data.nodes.filter(function(d) { .text(nGateways + " Gateways")
return d.flags.gateway
}).length) + " Gateways")
d3.select("#clientcount") d3.select("#clientcount")
.text((data.nodes.filter(function(d) { .text("ungefähr " + (nClients - nNodes) + " Clients")
return d.flags.client
}).length) + " Clients")
update() update()
}) })