diff options
author | Jordan <me@jordan.im> | 2019-08-10 02:57:40 -0700 |
---|---|---|
committer | Jordan <me@jordan.im> | 2019-08-10 02:57:40 -0700 |
commit | f21a1e86291657d74c4a42b6020e2d3565ecafb4 (patch) | |
tree | d4823d2a06b6aa838e19b76988d5a2c01bfa2a57 /tor-metrics/templates/relay-list.html | |
parent | 279721eb9df87672213ba8ae1856698efc5d3d5f (diff) | |
download | allium-f21a1e86291657d74c4a42b6020e2d3565ecafb4.tar.gz allium-f21a1e86291657d74c4a42b6020e2d3565ecafb4.zip |
per-relay pages, template cleanup
Diffstat (limited to 'tor-metrics/templates/relay-list.html')
-rw-r--r-- | tor-metrics/templates/relay-list.html | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/tor-metrics/templates/relay-list.html b/tor-metrics/templates/relay-list.html new file mode 100644 index 0000000..ec81115 --- /dev/null +++ b/tor-metrics/templates/relay-list.html @@ -0,0 +1,73 @@ +{% extends "skeleton.html" %} +{% block title %}Tor Relays{% endblock %} +{% block body %} +<h2>{% block header %}{% endblock %}</h2> +<p>{% block description %}{% endblock %}</p> +<table class="table table-condensed"> + <tr> + <th>Nickname</th> + <th>Bandwidth</th> + <th class="visible-md visible-lg">IP Address</th> + <th>AS Number</th> + <th>AS Name</th> + <th>Country</th> + <th>Platform</th> + <th>Flags</th> + <th class="visible-md visible-lg">Running</th> + <th class="visible-md visible-lg">First Seen</th> + </tr> + <tbody> + {% if is_index %}{% set relay_list = relays.json['relays'][:500] %} + {% else %}{% set relay_list = relays %}{% endif %} + {% for relay in relay_list %} + <tr> + {% if relay['observed_bandwidth'] > 1000000 %} + {% set obs_bandwidth = '%s %s'|format((relay['observed_bandwidth'] / 1000000)|round(2, 'common'), 'MB/s') %} + {% else %} + {% set obs_bandwidth = '%s %s'|format((relay['observed_bandwidth'] / 1000)|round(2, 'common'), 'KB/s') %}{% endif %} + + {% if deactivate != 'family' and relay['effective_family']|length > 1 %} + <td><a href="{{ path_prefix }}relay/{{ relay['fingerprint'] }}.html">{{ relay['nickname'] }}</a> (<a href="{{ path_prefix }}family/{{ relay['effective_family'][0] }}/">{{ relay['effective_family']|length }}</a>)</td> + {% else %} + <td><a href="{{ path_prefix}}relay/{{ relay['fingerprint'] }}.html">{{ relay['nickname'] }}</a></td>{% endif %} + <td>{{ obs_bandwidth }}</td> + + <td class="visible-md visible-lg">{{ relay['or_addresses'][0].split(':', 1)[0] }}</td> + + {% if relay['as'] %}{% if deactivate != 'as' %} + <td><a href="{{ path_prefix }}as/{{ relay['as'] }}/">{{ relay['as'] }}</a></td> + {% else %} + <td>{{ relay['as'] }}</td>{% endif %} + {% else %} + <td>Unknown</td>{% endif %} + + {% if relay['as_name'] %} + <td><a href="https://bgp.he.net/{{ relay['as'] }}" title="{{ relay['as_name'] }}">{{ relay['as_name'] |truncate(length=20) }}</a></td> + {% else %} + <td>Unknown</td>{% endif %} + + {% if relay['country'] %}{% if deactivate != 'country' %} + <td><a href="{{ path_prefix }}country/{{ relay['country'] }}/"><img src="{{ path_prefix }}static/images/cc/{{ relay['country'] }}.png" title="{{ relay['country_name'] }}" alt="{{ relay['country_name'] }}"></a></td> + {% else %} + <td><img src="{{ path_prefix }}static/images/cc/{{ relay['country'] }}.png" title="{{ relay['country_name'] }}" alt="{{ relay['country_name'] }}"></td>{% endif %} + {% else %} + <td>X</td>{% endif %} + + {% if deactivate != 'platform' %} + <td><a href="{{ path_prefix }}platform/{{ relay['platform'] }}/">{{ relay['platform'] }}</a></td> + {% else %} + <td>{{ relay['platform'] }}</td>{% endif %} + + <td>{% for flag in relay['flags'] %}{% if flag != 'StaleDesc' %}<img src="{{ path_prefix}}static/images/flags/{{ flag.lower() }}.png" title="{{ flag }}" alt="{{ flag }}"> {% endif %}{% endfor %}</td> + + {% if relay['running'] %} + <td class="visible-md visible-lg"><font color="green">True</font></td> + {% else %} + <td class="visible-md visible-lg"><font color="red">False</font></td>{% endif %} + + <td class="visible-md visible-lg">{{ relay['first_seen'].split(' ', 1)[0] }}</td> + </tr> + {% endfor %} + </tbody> +</table> +{% endblock %} |