2017-01-15 23:07:42 +00:00
{% 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 %}
2018-07-19 10:30:15 +00:00
{% load acl %}
{% load logs_extra %}
2018-08-05 16:48:22 +00:00
{% load i18n %}
2018-06-03 15:53:19 +00:00
2018-03-23 14:06:12 +00:00
< div class = "table-responsive" >
2018-07-19 10:30:15 +00:00
{% if machines_list.paginator %}
2019-01-08 23:39:31 +00:00
{% include 'pagination.html' with list=machines_list go_to_id="machines" %}
2018-07-19 10:30:15 +00:00
{% endif %}
2016-07-22 01:25:04 +00:00
2018-07-19 10:30:15 +00:00
< table class = "table" id = "machines_table" >
< colgroup >
< col >
< col >
< col >
< col width = "{% if ipv6_enabled %}300{% else %}150{% endif %}px" >
< col width = "144px" >
< / colgroup >
< thead >
2018-08-05 16:48:22 +00:00
{% trans "DNS name" as tr_dns_name %}
2019-01-08 23:39:31 +00:00
< th > {% include 'buttons/sort.html' with prefix='machine' col='name' text=tr_dns_name %}< / th >
2018-08-05 16:48:22 +00:00
< th > {% trans "Type" %}< / th >
< th > {% trans "MAC address" %}< / th >
< th > {% trans "IP address" %}< / th >
< th > {% trans "Actions" %}< / th >
2018-07-19 10:30:15 +00:00
< tbody >
2018-08-05 16:48:22 +00:00
{% for machine in machines_list %}
2018-07-19 10:30:15 +00:00
< tr class = "info" >
< td colspan = "4" >
2018-08-05 16:48:22 +00:00
{% trans "No name" as tr_no_name %}
{% trans "View the profile" as tr_view_the_profile %}
2019-01-24 18:00:20 +00:00
{% if machine.active %}
< span class = "text-success" >
{% else %}
2019-01-26 12:08:59 +00:00
< span class = "text-warning" > {% trans "Deactivated" %}:
2019-01-24 18:00:20 +00:00
{% endif %}
< b > {{ machine.get_name|default:tr_no_name }}< / b > < / span > < i class = "fa fa-angle-right" > < / i >
2018-08-05 16:48:22 +00:00
< a href = "{% url 'users:profil' userid=machine.user.id %}" title = tr_view_the_profile >
2018-07-19 10:30:15 +00:00
< i class = "fa fa-user" > < / i > {{ machine.user }}
< / a >
< / td >
< td class = "text-right" >
2019-01-08 23:39:31 +00:00
{% can_create Interface machine.id %}
{% trans "Create an interface" as tr_create_an_interface %}
{% include 'buttons/add.html' with href='machines:new-interface' id=machine.id desc=tr_create_an_interface %}
2018-09-24 17:31:12 +00:00
{% acl_end %}
{% history_button machine %}
{% can_delete machine %}
2019-01-08 23:39:31 +00:00
{% include 'buttons/suppr.html' with href='machines:del-machine' id=machine.id %}
2018-09-24 17:31:12 +00:00
{% acl_end %}
< / td >
< / tr >
{% for interface in machine.interface_set.all %}
2018-07-19 10:30:15 +00:00
< tr >
< td >
{% if interface.domain.related_domain.all %}
2018-09-24 17:31:12 +00:00
{{ interface.domain }}
< button class = "btn btn-default btn-xs" type = "button" data-toggle = "collapse"
data-target="#collapseDomain_{{ interface.id }}" aria-expanded="true"
aria-controls="collapseDomain_{{ interface.id }}">
{% trans "Display the aliases" %}
< / button >
2018-07-19 10:30:15 +00:00
{% else %}
2018-09-24 17:31:12 +00:00
{{ interface.domain }}
2018-07-19 10:30:15 +00:00
{% endif %}
< / td >
< td >
2019-03-03 16:28:33 +00:00
{{ interface.machine_type }}
2018-09-24 17:31:12 +00:00
< / td >
2018-07-19 10:30:15 +00:00
< td >
{{ interface.mac_address }}
2019-01-27 09:39:18 +00:00
< button class = "btn btn-default btn-xs" type = "button" data-toggle = "collapse"
data-target="#collapseVendor_{{ interface.id }}" aria-expanded="true"
aria-controls="collapseVendor_{{ interface.id }}">
{% trans "Display the vendor" %}
< / button >
2018-07-19 10:30:15 +00:00
< / td >
< td >
< b > IPv4< / b > {{ interface.ipv4 }}
< br >
2018-09-24 17:31:12 +00:00
{% if ipv6_enabled and interface.ipv6 != 'None' %}
< b > IPv6< / b >
< button class = "btn btn-default btn-xs" type = "button" data-toggle = "collapse"
data-target="#collapseIpv6_{{ interface.id }}" aria-expanded="true"
aria-controls="collapseIpv6_{{ interface.id }}">
{% trans "Display the IPv6 address" %}
< / button >
2018-07-19 10:30:15 +00:00
{% endif %}
< / td >
< td class = "text-right" >
< div style = "width: 128px;" >
< div class = "btn-group" role = "group" >
2018-09-24 17:31:12 +00:00
< button class = "btn btn-primary btn-sm dropdown-toggle" type = "button"
id="editioninterface" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="true">
2018-07-19 10:30:15 +00:00
< i class = "fa fa-edit" > < / i > < span class = "caret" > < / span >
< / button >
2018-08-05 16:48:22 +00:00
< ul class = "dropdown-menu" aria-labelledby = "editioninterface" >
2018-07-19 10:30:15 +00:00
{% can_edit interface %}
2018-09-24 17:31:12 +00:00
< li >
< a href = "{% url 'machines:edit-interface' interface.id %}" >
< i class = "fa fa-edit" > < / i >
{% trans " Edit" %}
< / a >
< / li >
2018-07-19 10:30:15 +00:00
{% acl_end %}
{% can_create Domain interface.id %}
2018-09-24 17:31:12 +00:00
< li >
< a href = "{% url 'machines:index-alias' interface.id %}" >
< i class = "fa fa-edit" > < / i >
{% trans " Manage the aliases" %}
< / a >
< / li >
2018-07-19 10:30:15 +00:00
{% acl_end %}
{% can_create Ipv6List interface.id %}
2018-09-24 17:31:12 +00:00
< li >
< a href = "{% url 'machines:index-ipv6' interface.id %}" >
< i class = "fa fa-edit" > < / i >
{% trans " Manage the IPv6 addresses" %}
< / a >
< / li >
2018-07-19 10:30:15 +00:00
{% acl_end %}
2018-07-29 17:07:40 +00:00
{% can_create SshFp interface.machine.id %}
2018-09-24 17:31:12 +00:00
< li >
< a href = "{% url 'machines:index-sshfp' interface.machine.id %}" >
< i class = "fa fa-edit" > < / i >
{% trans " Manage the SSH fingerprints" %}
< / a >
< / li >
2018-06-23 15:59:34 +00:00
{% acl_end %}
2018-07-19 10:30:15 +00:00
{% can_create OuverturePortList %}
2018-09-24 17:31:12 +00:00
< li >
< a href = "{% url 'machines:port-config' interface.id %}" >
< i class = "fa fa-edit" > < / i >
{% trans " Manage the ports configuration" %}
< / a >
< / li >
2018-07-19 10:30:15 +00:00
{% acl_end %}
< / ul >
< / div >
{% history_button interface %}
{% can_delete interface %}
2019-01-08 23:39:31 +00:00
{% include 'buttons/suppr.html' with href='machines:del-interface' id=interface.id %}
2018-06-16 13:29:47 +00:00
{% acl_end %}
2018-07-19 10:30:15 +00:00
< / div >
< / td >
< / tr >
2019-01-27 09:39:18 +00:00
< tr >
< td colspan = 5 style = "border-top: none; padding: 1px;" >
< div class = "collapse in" id = "collapseVendor_{{ interface.id }}" >
< ul class = "list-group" style = "margin-bottom: 0;" >
< li class = "list-group-item col-xs-6 col-sm-6 col-md-6" style = "border: none;" >
{{ interface.get_vendor }}
< / li >
< / ul >
< / div >
< / td >
< / tr >
2018-09-24 17:31:12 +00:00
{% if ipv6_enabled and interface.ipv6 != 'None' %}
< tr >
< td colspan = 5 style = "border-top: none; padding: 1px;" >
< div class = "collapse in" id = "collapseIpv6_{{ interface.id }}" >
< ul class = "list-group" style = "margin-bottom: 0;" >
{% for ipv6 in interface.ipv6.all %}
< li class = "list-group-item col-xs-6 col-sm-6 col-md-6" style = "border: none;" >
{{ ipv6 }}
< / li >
{% endfor %}
< / ul >
< / div >
< / td >
< / tr >
2018-08-05 16:48:22 +00:00
{% endif %}
{% if interface.domain.related_domain.all %}
2018-09-24 17:31:12 +00:00
< tr >
< td colspan = 5 style = "border-top: none; padding: 1px;" >
< div class = "collapse in" id = "collapseDomain_{{ interface.id }}" >
< ul class = "list-group" style = "margin-bottom: 0;" >
{% for al in interface.domain.related_domain.all %}
< li class = "list-group-item col-xs-6 col-sm-4 col-md-3" style = "border: none;" >
< a href = "http://{{ al }}" >
{{ al }}
< i class = "fa fa-share" > < / i >
< / a >
< / li >
{% endfor %}
< / ul >
< / div >
< / td >
< / tr >
2018-08-05 16:48:22 +00:00
{% endif %}
{% endfor %}
2018-09-24 17:31:12 +00:00
< tr >
< td colspan = "8" > < / td >
< / tr >
{% endfor %}
< / tbody >
2018-07-19 10:30:15 +00:00
< / table >
2016-07-04 00:48:24 +00:00
2018-07-19 10:30:15 +00:00
< script >
2018-09-24 17:31:12 +00:00
$("#machines_table").ready(function () {
var alias_div = [{% for machine in machines_list %}{% for interface in machine.interface_set.all %}{% if interface.domain.related_domain.all %}$("#collapseDomain_{{ interface.id }}"), {% endif %}{% endfor %}{% endfor %}];
for (var i = 0; i < alias_div.length ; i + + ) {
alias_div[i].collapse('hide');
}
});
$("#machines_table").ready(function () {
var ipv6_div = [{% for machine in machines_list %}{% for interface in machine.interface_set.all %}{% if interface.ipv6.all %}$("#collapseIpv6_{{ interface.id }}"), {% endif %}{% endfor %}{% endfor %}];
for (var i = 0; i < ipv6_div.length ; i + + ) {
ipv6_div[i].collapse('hide');
}
});
2019-01-27 09:39:18 +00:00
$("#machines_table").ready(function () {
var vendor_div = [{% for machine in machines_list %}{% for interface in machine.interface_set.all %}{% if interface.get_vendor %}$("#collapseVendor_{{ interface.id }}"), {% endif %}{% endfor %}{% endfor %}];
for (var i = 0; i < vendor_div.length ; i + + ) {
vendor_div[i].collapse('hide');
}
});
2018-07-19 10:30:15 +00:00
< / script >
2018-01-01 22:04:26 +00:00
2018-07-19 10:30:15 +00:00
{% if machines_list.paginator %}
2019-01-08 23:39:31 +00:00
{% include 'pagination.html' with list=machines_list go_to_id="machines" %}
2018-07-19 10:30:15 +00:00
{% endif %}
2018-03-23 14:06:12 +00:00
< / div >