From: opi Date: Thu, 10 Dec 2015 08:35:38 +0000 (+0100) Subject: Prise en compte des relais inactifs dans le script de bande passante. X-Git-Url: https://nos-oignons.net/gitweb/website.git/commitdiff_plain/95210ec74f9a5d2e30921e6f145b9b0d732854fe Prise en compte des relais inactifs dans le script de bande passante. --- diff --git a/assets/bw_graphs.js b/assets/bw_graphs.js index bed5e11..ebfc192 100644 --- a/assets/bw_graphs.js +++ b/assets/bw_graphs.js @@ -61,6 +61,13 @@ BwDrawer.color.domain(nos_oignons_relays.map(function(r) {return r.fingerprint}) BwDrawer.color.range(nos_oignons_relays.map(function(r) {return r.color})); BwDrawer.draw_bandwidth_graph = function(raw_data, selector, period) { + // Purge non running relays + raw_data.relays.forEach(function(r, i) { + if (typeof r.read_history === 'undefined' || typeof r.write_history === 'undefined') { + raw_data.relays.splice(i, 1); + } + }); + var update_period; var svg = d3.select(selector).append("svg")