{% extends "conntrackt/base.html" %}
{# For html_link. #}
{% load conntrackt_tags %}
{% block content %}
{# Use a bit shorter variable names. #}
{% with project=entity.project location=entity.location %}
{% if entity %}
<div class="row">
<h1 class="span12">{{entity.name}}</h1>
</div>
@@ -17,30 +15,91 @@
<div class="span12">
{{entity.description}}
<hr>
{% endif %}
{% html_link "Edit" "entity_update" entity.id class="btn btn-primary" %}
{% html_link "Remove" "entity_delete" entity.id class="btn btn-primary" %}
{% html_link "Get Iptables" 'entity_iptables' entity.id class="btn btn-primary" %}
<div class="span6">
<div class="well">
<table class="table table-striped">
<tr>
<th colspan="2">General information</th>
</tr>
<th>Project</th><td style="width:99%">{% html_link project.name 'project' project.id %}</td>
<th>Location</th><td>{{location}}</td>
</table>
<th style="width:99%">Interfaces</th>
{% for interface in interfaces %}
<td>{{interface.name}} ({{interface.address}}/{{interface.netmask}})</td>
{% endfor %}
<dl>
<dt>Project</dt><dd>{% html_link project.name 'project' project.id %}</dd>
<dt>Location</dt><dd>{{location.name}}</dd>
<dt>Incoming communications</dt><dd><ul class="unstyled">{% for interface in entity.interface_set.all %}
{% for communication in interface.destination_set.all %}
<li>{{communication.source}} - {{communication.protocol}}: {{communication.port}}</li>
{% endfor %}{% endfor %}</ul></dd>
<dt>Outgoing communications</dt><dd><ul class="unstyled">{% for interface in entity.interface_set.all %}
{% for communication in interface.source_set.all %}
<li>{{communication.destination}} - {{communication.protocol}}: {{communication.port}}</li>
<dt>iptables rules</dt><dd><pre>{{ entity_iptables }}</pre>{% html_link 'Download' 'entity_iptables' entity.id class="btn btn-primary input-small" %}</dd>
</dl>
<th>Incoming communications</th>
{% for comm in incoming_communications %}
<tr><td>{{comm.source}} - {{comm.protocol}}: {{comm.port}}</td></tr>
<th>Outgoing communications</th>
{% for comm in outgoing_communications %}
<tr><td>{{comm.destination}} - {{comm.protocol}}: {{comm.port}}</td></tr>
<div>
<p><strong>Iptables rules</strong></p>
<pre>{{ entity_iptables }}</pre>
{% endwith %}
{% endblock %}