mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
72 lines
3.0 KiB
HTML
72 lines
3.0 KiB
HTML
<tr class="powerport{% if pp.connected_endpoint %} {% if pp.connection_status %}success{% else %}info{% endif %}{% endif %}">
|
|
|
|
{# Name #}
|
|
<td>
|
|
<i class="fa fa-fw fa-bolt"></i> {{ pp }}
|
|
</td>
|
|
|
|
{# Cable #}
|
|
<td>
|
|
{% with cable=pp.get_connected_cable %}
|
|
{% if cable %}
|
|
Cable <a href="{{ cable.get_absolute_url }}">{{ cable }}</a>
|
|
{% if cable.far_end != pp.connected_endpoint %}
|
|
to <a href="{{ cable.far_end.device.get_absolute_url }}">{{ cable.far_end.device }}</a> {{ cable.far_end }}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endwith %}
|
|
</td>
|
|
|
|
{# Connection #}
|
|
{% if pp.connected_endpoint %}
|
|
<td>
|
|
<a href="{% url 'dcim:device' pk=pp.connected_endpoint.device.pk %}">{{ pp.connected_endpoint.device }}</a>
|
|
</td>
|
|
<td>
|
|
{{ pp.connected_endpoint }}
|
|
</td>
|
|
{% else %}
|
|
<td colspan="2">
|
|
<span class="text-muted">Not connected</span>
|
|
</td>
|
|
{% endif %}
|
|
|
|
{# Actions #}
|
|
<td class="text-right">
|
|
{% if perms.dcim.change_powerport %}
|
|
{% if pp.connected_endpoint %}
|
|
{% if pp.connection_status %}
|
|
<a href="#" class="btn btn-warning btn-xs powerport-toggle connected" title="Mark planned" data="{{ pp.pk }}">
|
|
<i class="glyphicon glyphicon-ban-circle" aria-hidden="true"></i>
|
|
</a>
|
|
{% else %}
|
|
<a href="#" class="btn btn-success btn-xs powerport-toggle" title="Mark installed" data="{{ pp.pk }}">
|
|
<i class="fa fa-plug" aria-hidden="true"></i>
|
|
</a>
|
|
{% endif %}
|
|
<a href="{% url 'dcim:powerport_disconnect' pk=pp.pk %}" title="Delete connection" class="btn btn-danger btn-xs">
|
|
<i class="glyphicon glyphicon-resize-full" aria-hidden="true"></i>
|
|
</a>
|
|
{% else %}
|
|
<a href="{% url 'dcim:powerport_connect' termination_a_id=pp.pk %}" title="Connect" class="btn btn-success btn-xs">
|
|
<i class="glyphicon glyphicon-resize-small" aria-hidden="true"></i>
|
|
</a>
|
|
{% endif %}
|
|
<a href="{% url 'dcim:powerport_edit' pk=pp.pk %}" title="Edit port" class="btn btn-info btn-xs">
|
|
<i class="glyphicon glyphicon-pencil" aria-hidden="true"></i>
|
|
</a>
|
|
{% endif %}
|
|
{% if perms.dcim.delete_powerport %}
|
|
{% if pp.connected_endpoint %}
|
|
<button class="btn btn-danger btn-xs" disabled="disabled">
|
|
<i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
|
|
</button>
|
|
{% else %}
|
|
<a href="{% url 'dcim:powerport_delete' pk=pp.pk %}?return_url={{ device.get_absolute_url }}" title="Delete port" class="btn btn-danger btn-xs">
|
|
<i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
|
|
</a>
|
|
{% endif %}
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|