Files
@ 744593ed423d
Branch filter:
Location: conntrackt/conntrackt/templates/conntrackt/entity_detail.html
744593ed423d
4.1 KiB
text/html
CONNT-6: Implemented editing of communications from within the application. Cleaned-up the entity details template to have better looks.
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 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | {% extends "conntrackt/base.html" %}
{# For html_link. #}
{% load conntrackt_tags %}
{% block content %}
{% if entity %}
<div class="row">
<h1 class="span12">{{entity.name}}</h1>
</div>
{% if entity.description %}
<div class="row">
<div class="span12">
{{entity.description}}
</div>
</div>
<hr>
{% endif %}
<div class="row">
<div class="span12">
{% 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>
</div>
<hr>
<div class="row">
<div class="span6">
<h2>General information</h2>
<div class="well">
<table class="table table-striped">
<tr>
<th>Project</th><td style="width:99%">{% html_link project.name 'project' project.id %}</td>
</tr>
<tr>
<th>Location</th><td>{{location}}</td>
</tr>
</table>
</div>
</div>
<div class="span6">
<h2>Interfaces</h2>
<div class="well">
{% if interfaces %}
<table class="table table-striped">
{% for interface in interfaces %}
<tr>
<td style="width:99%"><p>{{interface.name}} ({{interface.address}}/{{interface.netmask}})</p></td>
<td>{% html_link '<i class="icon-edit"></i>' 'interface_update' interface.id class="btn btn-link" %}</td>
<td>{% html_link '<i class="icon-remove"></i>' 'interface_delete' interface.id class="btn btn-link" %}</td>
</tr>
{% endfor %}
</table>
{% else %}
<p>No interfaces are defined for this entity.</p>
{% endif %}
<div>
{% with entity_id=entity.id|slugify %}
{% html_link "Add interface" "interface_create" class="btn btn-primary btn-mini" get="entity="|add:entity_id %}
{% endwith %}
</div>
</div>
</div>
</div>
<div class="row">
<div class="span6">
<h2>Incoming communications</h2>
<div class="well">
{% if incoming_communications %}
<table class="table table-striped">
{% for comm in incoming_communications %}
<tr>
<td style="width:99%">{% html_link comm.source_representation "entity" comm.source.entity.id class="btn btn-link" %}</td>
<td>{% html_link '<i class="icon-edit"></i>' 'communication_update' comm.id class="btn btn-link" %}</td>
<td>{% html_link '<i class="icon-remove"></i>' 'communication_delete' comm.id class="btn btn-link" %}</td>
</tr>
{% endfor %}
</table>
{% else %}
<p>No incoming communications towards this entity.</p>
{% endif %}
<div>
{% with entity_id=entity.id|slugify %}
{% html_link "Add communication" "communication_create" class="btn btn-primary btn-mini" get="to_entity="|add:entity_id %}
{% endwith %}
</div>
</div>
</div>
<div class="span6">
<h2>Outgoing communications</h2>
<div class="well">
{% if outgoing_communications %}
<table class="table table-striped">
{% for comm in outgoing_communications %}
<tr>
<td style="width:99%">{% html_link comm.destination_representation "entity" comm.destination.entity.id class="btn btn-link" %}</td>
<td>{% html_link '<i class="icon-edit"></i>' 'communication_update' comm.id class="btn btn-link" %}</td>
<td>{% html_link '<i class="icon-remove"></i>' 'communication_delete' comm.id class="btn btn-link" %}</td>
</tr>
{% endfor %}
</table>
{% else %}
<p>No outgoing communications from this entity.</p>
{% endif %}
<div>
{% with entity_id=entity.id|slugify %}
{% html_link "Add communication" "communication_create" class="btn btn-primary btn-mini" get="from_entity="|add:entity_id %}
{% endwith %}
</div>
</div>
</div>
<div class="span12">
<h2>Iptables rules</h2>
<div class="well">
<pre>{{ entity_iptables }}</pre>
<div>
{% html_link "Download" 'entity_iptables' entity.id class="btn btn-primary" %}
</div>
</div>
</div>
</div>
{% endif %}
{% endblock %}
|