|
@@ -240,38 +240,44 @@
|
|
|
{% for iface in mgmt_interfaces %}
|
|
|
{% include 'dcim/inc/interface.html' with icon='wrench' %}
|
|
|
{% empty %}
|
|
|
- <tr>
|
|
|
- <td colspan="5" class="alert-warning">
|
|
|
- <i class="fa fa-fw fa-warning"></i> No management interfaces defined
|
|
|
- {% if perms.dcim.add_interface %}
|
|
|
- <a href="{% url 'dcim:interface_add' pk=device.pk %}?mgmt_only=1" class="btn btn-primary btn-xs pull-right"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a>
|
|
|
- {% endif %}
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
+ {% if device.device_type.interface_templates.exists %}
|
|
|
+ <tr>
|
|
|
+ <td colspan="6" class="alert-warning">
|
|
|
+ <i class="fa fa-fw fa-warning"></i> No management interfaces defined
|
|
|
+ {% if perms.dcim.add_interface %}
|
|
|
+ <a href="{% url 'dcim:interface_add' pk=device.pk %}?mgmt_only=1" class="btn btn-primary btn-xs pull-right"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a>
|
|
|
+ {% endif %}
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ {% endif %}
|
|
|
{% endfor %}
|
|
|
{% for cp in console_ports %}
|
|
|
{% include 'dcim/inc/consoleport.html' %}
|
|
|
{% empty %}
|
|
|
- <tr>
|
|
|
- <td colspan="5" 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>
|
|
|
+ {% 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 %}
|
|
|
- <tr>
|
|
|
- <td colspan="5" 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>
|
|
|
+ {% 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 %}
|