aff_switch.html 3.64 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.

Copyright © 2017  Gabriel Détraz
Copyright © 2017  Goulven Kermarec
Copyright © 2017  Augustin Lemesle

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
{% endcomment %}

25
{% load acl %}
26
{% load logs_extra %}
27
{% load i18n %}
28

29
<div class="table-responsive">
30
    {% if switch_list.paginator %}
31
        {% include 'pagination.html' with list=switch_list %}
32
    {% endif %}
Gabriel Detraz's avatar
Gabriel Detraz committed
33

34 35 36
    <table class="table table-striped">
        <thead>
            <tr>
37
                {% trans "DNS name" as tr_dns %}
38
                <th>{% include 'buttons/sort.html' with prefix='switch' col='dns' text=tr_dns %}</th>
39
                {% trans "IPv4 address" as tr_ip %}
40
                <th>{% include 'buttons/sort.html' with prefix='switch' col='ip' text=tr_ip %}</th>
41
                {% trans "Switch bay" as tr_bay %}
42
                <th>{% include 'buttons/sort.html' with prefix='switch' col='loc' text=tr_bay %}</th>
43
	        {% trans "Ports" as tr_ports %}
44
                <th>{% include 'buttons/sort.html' with prefix='switch' col='ports' text=tr_ports %}</th>
45
                {% trans "Stack" as tr_stack %}
46
                <th>{% include 'buttons/sort.html' with prefix='switch' col='stack' text=tr_stack %}</th>
47 48 49
                <th>{% trans "Stack ID" %}</th>
                <th>{% trans "Switch model" %}</th>
                <th>{% trans "Details" %}</th>
50 51 52 53
                <th></th>
            </tr>
        </thead>
        {% for switch in switch_list %}
54 55
            <tr>
                <td>
56
                    <a href="{% url 'topologie:index-port' switch.id %}">
57 58 59 60 61 62 63 64 65 66 67 68
                    {{ switch }}
                    </a>
                </td>
                <td>{{ switch.interface_set.first.ipv4 }}</td>
                <td>{{ switch.switchbay }}</td>
                <td>{{ switch.number }}</td>
                <td>{{ switch.stack.name }}</td>
                <td>{{ switch.stack_member_id }}</td>
                <td>{{ switch.model }}</td>
                <td>{{ switch.interface_set.first.details }}</td>
                <td class="text-right">
                    {% can_edit switch %}
69
                    {% include 'buttons/edit.html' with href='topologie:edit-switch' id=switch.id %}
70 71 72 73 74 75 76
                    {% acl_end %}
                    {% history_button switch %}
                    {% can_delete switch %}
                    {% include 'buttons/suppr.html' with href='machines:del-machine' id=switch.id %} 
                    {% acl_end %}
                    {% can_create Port %}
                    {% trans "Creation of ports" as tr_creation %}
77
                    {% include 'buttons/add.html' with href='topologie:create-ports' id=switch.id desc=tr_creation %}
78 79 80
                    {% acl_end %}
                </td>
            </tr>
81 82
        {% endfor %}
    </table>
83

84
    {% if switch_list.paginator %}
85
    {% include 'pagination.html' with list=switch_list %}
86
    {% endif %}
87
</div>
88