index_portlist.html 1.9 KB
Newer Older
1 2 3 4
{% extends "machines/sidebar.html" %}

{% load bootstrap3 %}

5 6
{% load acl %}

7 8 9 10
{% block title %}Configuration de ports{% endblock %}

{% block content %}
  <h2>Liste des configurations de ports</h2>
11
  {% can_create OuverturePortList %}
12
  <a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:add-portlist' %}"><i class="fa fa-plus"></i>Ajouter une configuration</a>
13
  {% acl_end %}
14 15 16 17
  <table class="table table-striped">
    <thead>
      <tr>
	<th>Nom</th>
18 19 20 21
	<th>TCP (entrée)</th>
	<th>TCP (sortie)</th>
	<th>UDP (entrée)</th>
	<th>UDP (sortie)</th>
22
        <th>Machines</th>
23 24 25 26 27 28
	<th></th>
      </tr>
    </thead>
    {% for pl in port_list %}
    <tr>
      <td>{{pl.name}}</td>
29 30 31 32
      <td>{% for p in pl.tcp_ports_in %}{{p.show_port}}, {%endfor%}</td>
      <td>{% for p in pl.tcp_ports_out %}{{p.show_port}}, {%endfor%}</td>
      <td>{% for p in pl.udp_ports_in %}{{p.show_port}}, {%endfor%}</td>
      <td>{% for p in pl.udp_ports_out %}{{p.show_port}}, {%endfor%}</td>
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
      <td>
      {% if pl.interface_set.all %}
	<div class="dropdown">
	    <button class="btn btn-default dropdown-toggle" type="button" id="editioninterface" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                	 <span class="caret"></span>
	    </button>
	    <ul class="dropdown-menu" aria-labelledby="editioninterface">
	    {% for interface in pl.interface_set.all %}
		<li>
                   <a href="{% url 'users:profil' userid=interface.machine.user.id %}">
			{{ interface }}
		   </a>
		</li>
	    {% endfor %}
	    </ul>
	</div>
      {% endif %}
50
	<td class="text-right">
51
          {% can_delete pl %}
52
	  {% include 'buttons/suppr.html' with href='machines:del-portlist' id=pl.id %}
53 54
	  {% acl_end %}
	  {% can_edit pl %}
55
	  {% include 'buttons/edit.html' with href='machines:edit-portlist' id=pl.id %}
56
	  {% acl_end %}
57 58 59 60 61 62 63
        </td>
    </tr>
    {%endfor%}
  </table>
  <br />
  <br />
  <br />
64

65
{% endblock %}