commit e7f40d1ac7227a3749db9c0e2c652afb5e887c20 Author: Philipp Winter phw@torproject.org Date: Wed Mar 12 22:28:14 2014 +0100
Display relay's bandwidth values as tooltip.
When moving the mouse over the bandwidth value under "Advertised Bandwidth", a tool tip shows the bandwidth rate, burst, and the observed bandwidth of the respective relay.
This should fix https://bugs.torproject.org/11195. --- js/models/relay.js | 3 +++ templates/details/main.html | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/js/models/relay.js b/js/models/relay.js index d32b237..1cf27fc 100644 --- a/js/models/relay.js +++ b/js/models/relay.js @@ -141,6 +141,9 @@ define([ relay.dir_address = relay.dir_address ? relay.dir_address : null; relay.exit_policy = relay.exit_policy ? relay.exit_policy : null; relay.exit_policy_summary = relay.exit_policy_summary ? relay.exit_policy_summary : null; + relay.bandwidthr = relay.bandwidth_rate ? hrBandwidth(relay.bandwidth_rate) : null; + relay.bandwidthb = relay.bandwidth_burst ? hrBandwidth(relay.bandwidth_burst) : null; + relay.obandwidth = relay.observed_bandwidth ? hrBandwidth(relay.observed_bandwidth) : null; relay.bandwidth = relay.advertised_bandwidth ? relay.advertised_bandwidth : null; relay.bandwidth_hr = relay.advertised_bandwidth ? hrBandwidth(relay.advertised_bandwidth) : null; relay.family = relay.family ? relay.family : null; diff --git a/templates/details/main.html b/templates/details/main.html index dcd31ec..3f51407 100644 --- a/templates/details/main.html +++ b/templates/details/main.html @@ -35,7 +35,7 @@ <dt> <span class="tip" data-content="Bandwidth that the relay is willing and able to provide in bytes per second." data-original-title="Advertised bandwidth">Advertised Bandwidth</span> </dt> - <dd><%= relay.get('bandwidth_hr') %></dd> + <dd><span class="tip" data-content="Bandwidth rate: <%= relay.get('bandwidthr') %><br>Bandwidth burst: <%= relay.get('bandwidthb') %><br>Observed bandwidth: <%= relay.get('obandwidth') %>" data-original-title="Bandwidth values"><%= relay.get('bandwidth_hr') %></span></dd> <dt><span class="tip" data-content="Port summary of exit connections that the relay is going to accept or reject." data-original-title="Exit policy summary">Exit Policy Summary</span></dt> <dd> <% if ('accept' in relay.get('exit_policy_summary')) { %>