commit fe58cadbb5db75cb749f31a1803131ef29096630 Author: Philipp Winter phw@torproject.org Date: Mon May 26 19:13:55 2014 +0200
Make Atlas understand "exit_policy_v6_summary".
If present, the "exit_policy_v6_summary" data is displayed right underneath its IPv4 equivalent. In addition, we reduce the vertical size of the <pre> environment so that the additional IPv6 box doesn't waste too much space.
This should fix bug https://bugs.torproject.org/12124. --- css/bootstrap.css | 2 +- js/models/relay.js | 1 + templates/details/main.html | 11 ++++++++++- 3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/css/bootstrap.css b/css/bootstrap.css index e60bb20..c180aab 100644 --- a/css/bootstrap.css +++ b/css/bootstrap.css @@ -494,7 +494,7 @@ pre.prettyprint { }
pre.pre-scrollable { - max-height: 340px; + max-height: 140px; overflow-y: scroll; }
diff --git a/js/models/relay.js b/js/models/relay.js index 1cf27fc..d31f2ad 100644 --- a/js/models/relay.js +++ b/js/models/relay.js @@ -141,6 +141,7 @@ 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.exit_policy_v6_summary = relay.exit_policy_v6_summary ? relay.exit_policy_v6_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; diff --git a/templates/details/main.html b/templates/details/main.html index 3f51407..3d23a96 100644 --- a/templates/details/main.html +++ b/templates/details/main.html @@ -36,7 +36,7 @@ <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><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> + <dt><span class="tip" data-content="Port summary of IPv4 exit connections that the relay is going to accept or reject." data-original-title="IPv4 exit policy summary">IPv4 Exit Policy Summary</span></dt> <dd> <% if ('accept' in relay.get('exit_policy_summary')) { %> <pre class="pre-scrollable">accept<% _.each(relay.get('exit_policy_summary')['accept'], @@ -45,6 +45,15 @@ <pre class="pre-scrollable">reject<% _.each(relay.get('exit_policy_summary')['reject'], function(ports) { %><br> <%= $.trim(ports) %><% });} %></pre> </dd> + <dt><span class="tip" data-content="Port summary of IPv6 exit connections that the relay is going to accept or reject." data-original-title="IPv6 exit policy summary">IPv6 Exit Policy Summary</span></dt> + <dd> + <% if (relay.get('exit_policy_v6_summary') && ('accept' in relay.get('exit_policy_v6_summary'))) { %> + <pre class="pre-scrollable">accept<% _.each(relay.get('exit_policy_v6_summary')['accept'], + function(ports) { %><br> <%= $.trim(ports) %><% });} %></pre> + <% if (relay.get('exit_policy_v6_summary') && ('reject' in relay.get('exit_policy_v6_summary'))) { %> + <pre class="pre-scrollable">reject<% _.each(relay.get('exit_policy_v6_summary')['reject'], + function(ports) { %><br> <%= $.trim(ports) %><% });} %></pre> + </dd> <dt><span class="tip" data-content="Policy of exit connections that the relay is going to accept or reject." data-original-title="Exit policy">Exit Policy</span></dt> <dd> <pre class="pre-scrollable"><% _.each(relay.get('exit_policy'), function(line) { %>
tor-commits@lists.torproject.org