From 87c21d189f042876b544b248ce39e99c16f52b74 Mon Sep 17 00:00:00 2001 From: Jordan Date: Mon, 7 Sep 2020 18:27:57 -0700 Subject: add more sorting options for family and network pages --- tor-metrics/templates/misc-networks.html | 59 ++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 tor-metrics/templates/misc-networks.html (limited to 'tor-metrics/templates/misc-networks.html') diff --git a/tor-metrics/templates/misc-networks.html b/tor-metrics/templates/misc-networks.html new file mode 100644 index 0000000..97b7c28 --- /dev/null +++ b/tor-metrics/templates/misc-networks.html @@ -0,0 +1,59 @@ +{% extends "skeleton.html" %} +{% set sorted_by_label = sorted_by.split(',')[0].split('.')[1] %} +{% block title %}Tor Relays :: Networks By {{ sorted_by_label|replace('_', ' ')|title }}{% endblock %} +{% block body %} +

Home :: Networks By {{ sorted_by_label|replace('_', ' ')|title }}

+

The set of all ({{ relays.json['sorted']['as']|length }}) recognized networks running at least one relay sorted by {{ sorted_by_label|replace('_', ' ') }}. This data is onionoo-derived and might be out of date with respect to other sources.

+ + + + + + {% if sorted_by_label == 'bandwidth' %} + + {% else %} + + {% endif %} + {% if sorted_by_label == 'exit_count' %} + + {% else %} + + {% endif %} + {% if sorted_by_label == 'middle_count' %} + + {% else %} + + {% endif %} + + + {% for k, v in relays.json['sorted']['as'].items()|sort(attribute=sorted_by, reverse=True) %} + + {% if v['bandwidth'] > 1000000 %} + {% set obs_bandwidth = '%s %s'|format((v['bandwidth'] / 1000000)|round(2, 'common'), 'MB/s') %} + {% else %} + {% set obs_bandwidth = '%s %s'|format((v['bandwidth'] / 1000)|round(2, 'common'), 'KB/s') %}{% endif %} + + + + {% if v['as_name'] %} + + {% else %} + + {% endif %} + + {% if v['country'] %} + + {% else %} + + {% endif %} + + + + + + + + {% endfor %} + +
AS NumberAS NameCountryBandwidthBandwidthExit CountExit CountMiddle CountMiddle Count
{{ k|escape }}{{ v['as_name']|truncate(20)|escape }}Unknown{{ v['country_name']|escape }}X{{ obs_bandwidth }}{{ v['exit_count'] }}{{ v['middle_count'] }}
+{% endblock %} -- cgit v1.2.3-54-g00ecf