summaryrefslogtreecommitdiffstats
path: root/templates/mirrors/mirror_details.html
blob: 3218cdce0b0ae4c58de19ac714d1d794489eb8d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
{% extends "base.html" %}
{% load static from staticfiles %}
{% load mirror_status %}

{% block title %}Arch Linux - {{ mirror.name }} - Mirror Details{% endblock %}

{% block content %}
<!-- TODO: ids and classes -->
<div id="pkgdetails" class="box">

    <h2>Mirror Details: {{ mirror.name }}</h2>

    <table id="pkginfo">
        <tr>
            <th>Name:</th>
            <td>{{ mirror.name }}</td>
        </tr>
        <tr>
            <th>Tier:</th>
            <td>{{ mirror.get_tier_display }}</td>
        </tr>
        <tr>
            <th>Country:</th>
            <td>{% if mirror.country %}<img src="{{ mirror.country.flag }}"/> {% endif %}{{ mirror.country.name|default:'Worldwide' }}</td>
        </tr>
        <tr>
            <th>Has ISOs:</th>
            <td>{{ mirror.isos|yesno|capfirst }}</td>
        </tr>
        {% if user.is_authenticated %}
        <tr>
            <th>Public:</th>
            <td>{{ mirror.public|yesno|capfirst }}</td>
        </tr>
        <tr>
            <th>Active:</th>
            <td>{{ mirror.active|yesno|capfirst }}</td>
        </tr>
        <tr>
            <th>Rsync IPs:</th>
            <td class="wrap">{{mirror.rsync_ips.all|join:', '}}</td>
        </tr>
        <tr>
            <th>Admin Email:</th>
            <td>{% if mirror.admin_email %}<a href="mailto:{{ mirror.admin_email }}">{{ mirror.admin_email }}</a>{% else %}None{% endif %}</td>
        </tr>
        <tr>
            <th>Notes:</th>
            <td>{{ mirror.notes|linebreaks }}</td>
        </tr>
        <tr>
            <th>Upstream:</th>
            <td>{% if mirror.upstream %}
                <a href="{{ mirror.upstream.get_absolute_url }}"
                    title="Mirror details for {{ mirror.upstream.name }}">{{ mirror.upstream.name }}</a>
                {% else %}None{% endif %}</td>
        </tr>
        <tr>
            <th>Downstream:</th>
            {% with mirror.downstream as ds_mirrors %}
            <td>{% if ds_mirrors %}
                {% for ds in ds_mirrors %}
                <a href="{{ ds.get_absolute_url }}"
                    title="Mirror details for {{ ds.name }}">{{ ds.name }}</a>
                {% if not ds.active %}<span class="testing-dep">(inactive)</span>{% endif %}
                {% if not ds.public %}<span class="testing-dep">(private)</span>{% endif %}
                <br/>
                {% endfor %}
                {% else %}None{% endif %}</td>
            {% endwith %}
        </tr>
        {% endif %}
    </table>

    <h3>Available URLs</h3>

    <table id="available_urls" class="results">
        <thead>
            <tr>
                <th>Mirror URL</th>
                <th>IPv4</th>
                <th>IPv6</th>
                <th>Last Sync</th>
                <th>Completion %</th>
                <th>μ Delay (hh:mm)</th>
                <th>μ Duration (secs)</th>
                <th>σ Duration (secs)</th>
                <th>Mirror Score</th>
            </tr>
        </thead>
        <tbody>
            {% for m_url in urls %}
            <tr class="{% cycle 'odd' 'even' %}">
                <td>{% if m_url.protocol.is_download %}<a href="{{ m_url.url }}">{{ m_url.url }}</a>{% else %}{{ m_url.url }}{% endif %}</td>
                <td>{{ m_url.has_ipv4|yesno|capfirst }}</td>
                <td>{{ m_url.has_ipv6|yesno|capfirst }}</td>
                <td>{{ m_url.last_sync|date:'Y-m-d H:i'|default:'unknown' }}</td>
                <td>{{ m_url.completion_pct|percentage:1 }}</td>
                <td>{{ m_url.delay|duration|default:'unknown' }}</td>
                <td>{{ m_url.duration_avg|floatformat:2 }}</td>
                <td>{{ m_url.duration_stddev|floatformat:2 }}</td>
                <td>{{ m_url.score|floatformat:1|default:'∞' }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>
{% load cdn %}{% jquery %}
<script type="text/javascript" src="{% static "jquery.tablesorter.min.js" %}"></script>
<script type="text/javascript" src="{% static "archweb.js" %}"></script>
<script type="text/javascript">
$(document).ready(function() {
    $("#available_urls:has(tbody tr)").tablesorter(
        {widgets: ['zebra'], sortList: [[0,0]],
        headers: { 6: { sorter: 'mostlydigit' }, 7: { sorter: 'mostlydigit' }, 8: { sorter: 'mostlydigit' } } });
});
</script>
{% endblock %}