|
|
@@ -35,6 +35,21 @@
|
|
|
</div>
|
|
|
<div class="pull-right">
|
|
|
{% if perms.dcim.change_device %}
|
|
|
+ <div class="btn-group">
|
|
|
+ <button type="button" class="btn btn-sm btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
|
+ <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add Components <span class="caret"></span>
|
|
|
+ </button>
|
|
|
+ <ul class="dropdown-menu">
|
|
|
+ {% if perms.dcim.add_consoleport %}<li><a href="{% url 'dcim:consoleport_add' pk=device.pk %}">Console Ports</a></li>{% endif %}
|
|
|
+ {% if perms.dcim.add_consoleserverport %}<li><a href="{% url 'dcim:consoleserverport_add' pk=device.pk %}">Console Server Ports</a></li>{% endif %}
|
|
|
+ {% if perms.dcim.add_powerport %}<li><a href="{% url 'dcim:powerport_add' pk=device.pk %}">Power Ports</a></li>{% endif %}
|
|
|
+ {% if perms.dcim.add_poweroutlet %}<li><a href="{% url 'dcim:poweroutlet_add' pk=device.pk %}">Power Outlets</a></li>{% endif %}
|
|
|
+ {% if perms.dcim.add_interface %}<li><a href="{% url 'dcim:interface_add' pk=device.pk %}">Interfaces</a></li>{% endif %}
|
|
|
+ {% if perms.dcim.add_frontport %}<li><a href="{% url 'dcim:frontport_add' pk=device.pk %}">Front Ports</a></li>{% endif %}
|
|
|
+ {% if perms.dcim.add_rearport %}<li><a href="{% url 'dcim:rearport_add' pk=device.pk %}">Rear Ports</a></li>{% endif %}
|
|
|
+ {% if perms.dcim.add_devicebay %}<li><a href="{% url 'dcim:devicebay_add' pk=device.pk %}">Device Bays</a></li>{% endif %}
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
<a href="{% url 'dcim:device_edit' pk=device.pk %}" class="btn btn-warning">
|
|
|
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
|
|
|
Edit this device
|
|
|
@@ -300,55 +315,35 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="col-md-6">
|
|
|
- <div class="panel panel-default">
|
|
|
- <div class="panel-heading">
|
|
|
- <strong>Console / Power</strong>
|
|
|
- </div>
|
|
|
- <table class="table table-hover panel-body component-list">
|
|
|
- {% for cp in console_ports %}
|
|
|
- {% include 'dcim/inc/consoleport.html' %}
|
|
|
- {% empty %}
|
|
|
- {% if device.device_type.console_port_templates.exists %}
|
|
|
- <tr>
|
|
|
- <td colspan="6" class="alert-warning">
|
|
|
- <i class="fa fa-fw fa-warning"></i> No console ports defined
|
|
|
- {% if perms.dcim.add_consoleport %}
|
|
|
- <a href="{% url 'dcim:consoleport_add' pk=device.pk %}" class="btn btn-primary btn-xs pull-right"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a>
|
|
|
- {% endif %}
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- {% endif %}
|
|
|
- {% endfor %}
|
|
|
- {% for pp in power_ports %}
|
|
|
- {% include 'dcim/inc/powerport.html' %}
|
|
|
- {% empty %}
|
|
|
- {% if device.device_type.power_port_templates.exists %}
|
|
|
- <tr>
|
|
|
- <td colspan="6" class="alert-warning">
|
|
|
- <i class="fa fa-fw fa-warning"></i> No power ports defined
|
|
|
- {% if perms.dcim.add_powerport %}
|
|
|
- <a href="{% url 'dcim:powerport_add' pk=device.pk %}" class="btn btn-primary btn-xs pull-right"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a>
|
|
|
- {% endif %}
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- {% endif %}
|
|
|
- {% endfor %}
|
|
|
- </table>
|
|
|
- {% if perms.dcim.add_interface or perms.dcim.add_consoleport or perms.dcim.add_powerport %}
|
|
|
- <div class="panel-footer text-right">
|
|
|
- {% if perms.dcim.add_consoleport %}
|
|
|
- <a href="{% url 'dcim:consoleport_add' pk=device.pk %}" class="btn btn-xs btn-primary">
|
|
|
- <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add console port
|
|
|
- </a>
|
|
|
- {% endif %}
|
|
|
- {% if perms.dcim.add_powerport %}
|
|
|
- <a href="{% url 'dcim:powerport_add' pk=device.pk %}" class="btn btn-xs btn-primary">
|
|
|
- <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add power port
|
|
|
- </a>
|
|
|
- {% endif %}
|
|
|
+ {% if console_ports or power_ports %}
|
|
|
+ <div class="panel panel-default">
|
|
|
+ <div class="panel-heading">
|
|
|
+ <strong>Console / Power</strong>
|
|
|
</div>
|
|
|
- {% endif %}
|
|
|
- </div>
|
|
|
+ <table class="table table-hover panel-body component-list">
|
|
|
+ {% for cp in console_ports %}
|
|
|
+ {% include 'dcim/inc/consoleport.html' %}
|
|
|
+ {% endfor %}
|
|
|
+ {% for pp in power_ports %}
|
|
|
+ {% include 'dcim/inc/powerport.html' %}
|
|
|
+ {% endfor %}
|
|
|
+ </table>
|
|
|
+ {% if perms.dcim.add_interface or perms.dcim.add_consoleport or perms.dcim.add_powerport %}
|
|
|
+ <div class="panel-footer text-right">
|
|
|
+ {% if perms.dcim.add_consoleport %}
|
|
|
+ <a href="{% url 'dcim:consoleport_add' pk=device.pk %}" class="btn btn-xs btn-primary">
|
|
|
+ <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add console port
|
|
|
+ </a>
|
|
|
+ {% endif %}
|
|
|
+ {% if perms.dcim.add_powerport %}
|
|
|
+ <a href="{% url 'dcim:powerport_add' pk=device.pk %}" class="btn btn-xs btn-primary">
|
|
|
+ <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add power port
|
|
|
+ </a>
|
|
|
+ {% endif %}
|
|
|
+ </div>
|
|
|
+ {% endif %}
|
|
|
+ </div>
|
|
|
+ {% endif %}
|
|
|
{% if request.user.is_authenticated %}
|
|
|
<div class="panel panel-default">
|
|
|
<div class="panel-heading">
|
|
|
@@ -501,7 +496,7 @@
|
|
|
</form>
|
|
|
{% endif %}
|
|
|
{% endif %}
|
|
|
- {% if interfaces or device.device_type.is_network_device %}
|
|
|
+ {% if interfaces %}
|
|
|
{% if perms.dcim.change_interface or perms.dcim.delete_interface %}
|
|
|
<form method="post">
|
|
|
{% csrf_token %}
|
|
|
@@ -534,10 +529,6 @@
|
|
|
<tbody>
|
|
|
{% for iface in interfaces %}
|
|
|
{% include 'dcim/inc/interface.html' %}
|
|
|
- {% empty %}
|
|
|
- <tr>
|
|
|
- <td colspan="9" class="text-center text-muted">— No interfaces defined —</td>
|
|
|
- </tr>
|
|
|
{% endfor %}
|
|
|
</tbody>
|
|
|
</table>
|
|
|
@@ -574,7 +565,7 @@
|
|
|
</form>
|
|
|
{% endif %}
|
|
|
{% endif %}
|
|
|
- {% if consoleserverports or device.device_type.is_console_server %}
|
|
|
+ {% if consoleserverports %}
|
|
|
{% if perms.dcim.delete_consoleserverport %}
|
|
|
<form method="post">
|
|
|
{% csrf_token %}
|
|
|
@@ -598,10 +589,6 @@
|
|
|
<tbody>
|
|
|
{% for csp in consoleserverports %}
|
|
|
{% include 'dcim/inc/consoleserverport.html' %}
|
|
|
- {% empty %}
|
|
|
- <tr>
|
|
|
- <td colspan="5" class="text-center text-muted">— No console server ports defined —</td>
|
|
|
- </tr>
|
|
|
{% endfor %}
|
|
|
</tbody>
|
|
|
</table>
|
|
|
@@ -633,7 +620,7 @@
|
|
|
</form>
|
|
|
{% endif %}
|
|
|
{% endif %}
|
|
|
- {% if poweroutlets or device.device_type.is_pdu %}
|
|
|
+ {% if poweroutlets %}
|
|
|
{% if perms.dcim.delete_poweroutlet %}
|
|
|
<form method="post">
|
|
|
{% csrf_token %}
|
|
|
@@ -657,10 +644,6 @@
|
|
|
<tbody>
|
|
|
{% for po in poweroutlets %}
|
|
|
{% include 'dcim/inc/poweroutlet.html' %}
|
|
|
- {% empty %}
|
|
|
- <tr>
|
|
|
- <td colspan="5" class="text-center text-muted">— No power outlets defined —</td>
|
|
|
- </tr>
|
|
|
{% endfor %}
|
|
|
</tbody>
|
|
|
</table>
|
|
|
@@ -716,10 +699,6 @@
|
|
|
<tbody>
|
|
|
{% for frontport in front_ports %}
|
|
|
{% include 'dcim/inc/frontport.html' %}
|
|
|
- {% empty %}
|
|
|
- <tr>
|
|
|
- <td colspan="5" class="text-center text-muted">— No front panel ports defined —</td>
|
|
|
- </tr>
|
|
|
{% endfor %}
|
|
|
</tbody>
|
|
|
</table>
|
|
|
@@ -737,7 +716,7 @@
|
|
|
{% if perms.dcim.add_frontport %}
|
|
|
<div class="pull-right">
|
|
|
<a href="{% url 'dcim:frontport_add' pk=device.pk %}" class="btn btn-primary btn-xs">
|
|
|
- <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add front panel ports
|
|
|
+ <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add front ports
|
|
|
</a>
|
|
|
</div>
|
|
|
<div class="clearfix"></div>
|
|
|
@@ -769,10 +748,6 @@
|
|
|
<tbody>
|
|
|
{% for rearport in rear_ports %}
|
|
|
{% include 'dcim/inc/rearport.html' %}
|
|
|
- {% empty %}
|
|
|
- <tr>
|
|
|
- <td colspan="5" class="text-center text-muted">— No rear panel ports defined —</td>
|
|
|
- </tr>
|
|
|
{% endfor %}
|
|
|
</tbody>
|
|
|
</table>
|
|
|
@@ -790,7 +765,7 @@
|
|
|
{% if perms.dcim.add_rearport %}
|
|
|
<div class="pull-right">
|
|
|
<a href="{% url 'dcim:rearport_add' pk=device.pk %}" class="btn btn-primary btn-xs">
|
|
|
- <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add rear panel ports
|
|
|
+ <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add rear ports
|
|
|
</a>
|
|
|
</div>
|
|
|
<div class="clearfix"></div>
|