add counts for unavailable / abuse / abuse_blocked hosts to status view

This commit is contained in:
Thomas Waldmann 2013-12-01 14:06:45 +01:00
parent bd0cf7c907
commit c20295e68b
2 changed files with 5 additions and 0 deletions

View File

@ -19,6 +19,8 @@
<dl>
<dt>Total:</dt>
<dd>{{ hosts_total }}</dd>
<dt>Unavailable / Abuse / Abuse-Blocked:</dt>
<dd>{{ hosts_unavailable }} / {{ hosts_abuse }} / {{ hosts_abuse_blocked }}</dd>
<dt>ip v4 (ssl) / v6 (ssl) updated last 2d:</dt>
<dd>{{ hosts_ipv4_2d }} ({{ hosts_ipv4_ssl_2d }}) / {{ hosts_ipv6_2d }} ({{ hosts_ipv6_ssl_2d }})</dd>
<dt>ip v4 (ssl) / v6 (ssl) updated last 2w:</dt>

View File

@ -101,6 +101,9 @@ class StatusView(TemplateView):
context['domains_unavailable'] = Domain.objects.filter(available=False).count()
context['domains_public'] = Domain.objects.filter(public=True).count()
context['hosts_total'] = Host.objects.count()
context['hosts_unavailable'] = Host.objects.filter(available=False).count()
context['hosts_abuse'] = Host.objects.filter(abuse=True).count()
context['hosts_abuse_blocked'] = Host.objects.filter(abuse_blocked=True).count()
t_now = now()
before_2d = t_now - timedelta(hours=48)
before_2w = t_now - timedelta(days=14)