Add details link to mirror status page

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2014-09-01 16:16:44 -05:00
parent 9335d3330b
commit a8ceba3429
4 changed files with 17 additions and 6 deletions

View File

@ -75,6 +75,12 @@ class MirrorUrl(models.Model):
created = models.DateTimeField(editable=False)
active = models.BooleanField(default=True)
class Meta:
verbose_name = 'mirror URL'
def __unicode__(self):
return self.url
def address_families(self):
hostname = urlparse(self.url).hostname
info = socket.getaddrinfo(hostname, None, 0, socket.SOCK_STREAM)
@ -101,11 +107,8 @@ def clean(self):
self.has_ipv4 = False
self.has_ipv6 = False
def __unicode__(self):
return self.url
class Meta:
verbose_name = 'mirror URL'
def get_absolute_url(self):
return '/mirrors/%s/%d/' % (self.mirror.name, self.pk)
class MirrorRsync(models.Model):

View File

@ -80,7 +80,9 @@ <h3>Mirror Syncing Error Log</h3>
<script type="text/javascript" src="{% static "archweb.js" %}"></script>
<script type="text/javascript">
$(document).ready(function() {
var headers = { 4: { sorter: 'duration' }, 5: { sorter: 'mostlydigit' }, 6: { sorter: 'mostlydigit' }, 7: { sorter: 'mostlydigit' } };
var headers = { 4: { sorter: 'duration' }, 5: { sorter: 'mostlydigit' },
6: { sorter: 'mostlydigit' }, 7: { sorter: 'mostlydigit' },
8: { sorter: false } };
$("#outofsync_mirrors:has(tbody tr)").tablesorter(
{widgets: ['zebra'], sortList: [[4,0]], headers: headers });
$("#successful_mirrors:has(tbody tr)").tablesorter(

View File

@ -11,6 +11,7 @@
<th>μ Duration (s)</th>
<th>σ Duration (s)</th>
<th>Mirror Score</th>
<th></th>
</tr>
</thead>
<tbody>
@ -23,6 +24,7 @@
<td>{{ m_url.duration_avg|floatvalue:2 }}</td>
<td>{{ m_url.duration_stddev|floatvalue:2 }}</td>
<td>{{ m_url.score|floatvalue:1|default:'∞' }}</td>
<td><a href="{{ m_url.get_absolute_url }}">details</a></td>
</tr>{% endfor %}
</tbody>
</table>

View File

@ -17,6 +17,10 @@ <h2>URL Details: {{ url.url }}</h2>
<th>URL:</th>
<td>{% if url.protocol.is_download %}<a href="{{ url.url }}">{{ url.url }}</a>{% else %}{{ url.url }}{% endif %}</td>
</tr>
<tr>
<th>Mirror:</th>
<td><a href="../">{{ url.mirror.name }}</a></td>
</tr>
<tr>
<th>Protocol:</th>
<td>{{ url.protocol }}</td>