summaryrefslogtreecommitdiff
path: root/templates/mirrors/url_details.html
blob: 201e189551108facb663c3d81232f37453d563bc (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
{% extends "base.html" %}
{% load cycle from future %}
{% load static from staticfiles %}
{% load mirror_status %}
{% load flags %}

{% block title %}Arch Linux - {{ url.url }} - URL Details{% endblock %}

{% block head %}<link rel="stylesheet" type="text/css" href="{% static "flags/fam.css" %}" media="screen, projection" />{% endblock %}

{% block content %}
<div class="box">
    <h2>URL Details: {{ url.url }}</h2>

    <table class="compact">
        <tr>
            <th>URL:</th>
            <td>{% if url.protocol.is_download %}<a href="{{ url.url }}">{{ url.url }}</a>{% else %}{{ url.url }}{% endif %}</td>
        </tr>
        <tr>
            <th>Protocol:</th>
            <td>{{ url.protocol }}</td>
        </tr>
        <tr>
            <th>Country:</th>
            <td class="country">{% country_flag url.country %}{{ url.country.name }}</td>
        </tr>
        <tr>
            <th>IPv4:</th>
            <td>{{ url.has_ipv4|yesno|capfirst }}</td>
        </tr>
        <tr>
            <th>IPv6:</th>
            <td>{{ url.has_ipv6|yesno|capfirst }}</td>
        </tr>
        {% if user.is_authenticated %}
        <tr>
            <th>Active:</th>
            <td>{{ url.active|yesno|capfirst }}</td>
        </tr>
        <tr>
            <th>Created:</th>
            <td>{{ url.created }}</td>
        </tr>
        <tr>
            <th>First Check:</th>
            <td>{{ url.logs.earliest.check_time }}</td>
        </tr>
        <tr>
            <th>Last Check:</th>
            <td>{{ url.logs.latest.check_time }}</td>
        </tr>
        {% endif %}
    </table>

    <h3>Check Logs</h3>

    <table id="check_logs" class="results">
        <thead>
            <tr>
                <th>Check Time</th>
                <th>Check Location</th>
                <th>Check IP</th>
                <th>Last Sync</th>
                <th>Delay (hh:mm)</th>
                <th>Duration (s)</th>
                <th>Success?</th>
                <th>Error Message</th>
            </tr>
        </thead>
        <tbody>
            {% for log in logs %}<tr class="{% cycle 'odd' 'even' %}">
                <td>{{ log.check_time|date:'Y-m-d H:i' }}</td>
                <td class="country">{% country_flag log.location.country %}{{ log.location.country.name }}</td>
                <td>{{ log.location.source_ip }}</td>
                <td>{{ log.last_sync|date:'Y-m-d H:i' }}</td>
                <td>{{ log.delay|duration }}</td>
                <td>{{ log.duration|floatvalue }}</td>
                <td>{{ log.is_success|yesno|capfirst }}</td>
                <td class="wrap">{{ log.error|linebreaksbr }}</td>
            </tr>{% endfor %}
        </tbody>
    </table>
</div>
{% endblock %}

{% block script_block %}
{% load cdn %}{% jquery %}{% jquery_tablesorter %}
<script type="text/javascript" src="{% static "archweb.js" %}"></script>
<script type="text/javascript">
$(document).ready(function() {
    $("#check_logs:has(tbody tr)").tablesorter(
        {widgets: ['zebra'], sortList: [[0,1]],
        headers: { 5: { sorter: 'mostlydigit' } } });
});
</script>
{% endblock %}