]> git.ipfire.org Git - ipfire.org.git/blobdiff - src/templates/fireinfo/admin.html
fireinfo: Show ASN map
[ipfire.org.git] / src / templates / fireinfo / admin.html
index bc2676c011044355f7e24fa254cdf10bcb70da41..345d847d10ed6e6d6e3bebf903a2901706c63f0a 100644 (file)
                </div>
        </section>
 
+       {% if asn_map %}
+               <section class="section">
+                       <div class="container">
+                               <h4 class="title is-4">{{ _("Autonomous Systems") }}</h4>
+
+                               <table class="table is-fullwidth">
+                                       <tr>
+                                               <th>{{ _("Autonomous System") }}</th>
+                                               <th class="has-text-right">{{ _("Total Profiles") }}</th>
+                                               <th class="has-text-right">{{ _("Percentage") }}</th>
+                                       </tr>
+
+                                       {% for asn in sorted(asn_map, key=lambda asn: asn_map[asn], reverse=True) %}
+                                               {% set c, p = asn_map[asn] %}
+
+                                               <tr>
+                                                       <th scope="row">{{ asn }}</th>
+                                                       <td class="has-text-right">
+                                                               {{ c }}
+                                                       </td>
+                                                       <td class="has-text-right">
+                                                               {{ "%.2f%%" % (p * 100) }}
+                                                       </td>
+                                               </tr>
+                                       {% end %}
+                               </table>
+                       </div>
+               </section>
+       {% end %}
+
        {% if histogram %}
                <section class="section">
                        <div class="container">