Commit eb26bc29 by Kálmán Viktor

network: separate latest blacklists table

parent c5254b04
......@@ -26,6 +26,28 @@
{% endfor %}
</table>
<div class="page-header">
<h1>Latest blacklists</h1>
</div>
<table class="table table-striped table-bordered">
<tr>
<th>IP</th>
<th>Reason</th>
<th>Type</th>
<th>Time elapsed</th>
</tr>
{% for b in latest_blacklists %}
<tr>
<td><a href="{{ b.get_absolute_url }}">{{ b.ipv4 }}</a></td>
<td>{{ b.reason }}</td>
<td>{{ b.type }}</td>
<td>{{ b.modified_at|timesince }}</td>
</tr>
{% endfor %}
</table>
<div class="page-header">
<h1>Dashboard <small>foo bar baz</small></h1>
</div>
......
......@@ -37,8 +37,8 @@ class IndexView(TemplateView):
rules = Rule.objects.all().order_by('-modified_at')[:size]
result_list = []
for i in (sorted(chain(blacklists, domains, groups, hosts,
records, vlans, vlangroups, rules),
for i in (sorted(chain(domains, groups, hosts, records, vlans,
vlangroups, rules),
key=lambda x: x.modified_at, reverse=True)[:size]):
result_list.append(
{
......@@ -49,6 +49,7 @@ class IndexView(TemplateView):
'link': i.get_absolute_url()
})
context['latest_blacklists'] = blacklists
context['latest'] = result_list
return context
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment