1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

79 lines
3.4 KiB
HTML
Raw Normal View History

<tr class="poweroutlet{% if po.connected_endpoint %} {% if po.connected_endpoint.connection_status %}success{% else %}info{% endif %}{% endif %}">
{# Checkbox #}
{% if perms.dcim.change_poweroutlet or perms.dcim.delete_poweroutlet %}
<td class="pk">
<input name="pk" type="checkbox" value="{{ po.pk }}" />
</td>
{% endif %}
{# Name #}
2016-03-01 11:23:03 -05:00
<td>
<i class="fa fa-fw fa-bolt"></i> {{ po }}
2016-03-01 11:23:03 -05:00
</td>
{# Cable #}
<td>
{% with cable=po.get_connected_cable %}
{% if cable %}
<a href="{{ cable.get_absolute_url }}">{{ cable }}</a>
2018-10-29 09:12:41 -04:00
{% if cable.far_end != po.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 po.connected_endpoint %}
2016-03-01 11:23:03 -05:00
<td>
<a href="{% url 'dcim:device' pk=po.connected_endpoint.device.pk %}">{{ po.connected_endpoint.device }}</a>
2016-03-01 11:23:03 -05:00
</td>
<td>
{{ po.connected_endpoint }}
2016-03-01 11:23:03 -05:00
</td>
{% else %}
2016-07-06 16:01:18 -04:00
<td colspan="2">
<span class="text-muted">Not connected</span>
</td>
2016-03-01 11:23:03 -05:00
{% endif %}
{# Actions #}
<td class="text-right">
2016-03-01 11:23:03 -05:00
{% if perms.dcim.change_poweroutlet %}
{% if po.connected_endpoint %}
{% if po.connected_endpoint.connection_status %}
<a href="#" class="btn btn-warning btn-xs powerport-toggle connected" title="Mark planned" data="{{ po.connected_endpoint.pk }}">
<i class="glyphicon glyphicon-ban-circle" aria-hidden="true"></i>
2016-03-01 11:23:03 -05:00
</a>
{% else %}
<a href="#" class="btn btn-success btn-xs powerport-toggle" title="Mark installed" data="{{ po.connected_endpoint.pk }}">
<i class="fa fa-plug" aria-hidden="true"></i>
2016-03-01 11:23:03 -05:00
</a>
{% endif %}
<a href="{% url 'dcim:poweroutlet_disconnect' pk=po.pk %}" title="Delete connection" class="btn btn-danger btn-xs">
<i class="glyphicon glyphicon-resize-full" aria-hidden="true"></i>
2016-03-01 11:23:03 -05:00
</a>
{% else %}
<a href="{% url 'dcim:poweroutlet_connect' termination_a_id=po.pk %}" title="Connect" class="btn btn-success btn-xs">
<i class="glyphicon glyphicon-resize-small" aria-hidden="true"></i>
2016-03-01 11:23:03 -05:00
</a>
{% endif %}
<a href="{% url 'dcim:poweroutlet_edit' pk=po.pk %}" title="Edit outlet" class="btn btn-info btn-xs">
<i class="glyphicon glyphicon-pencil" aria-hidden="true"></i>
2016-03-01 11:23:03 -05:00
</a>
{% endif %}
{% if perms.dcim.delete_poweroutlet %}
{% if po.connected_endpoint %}
2016-03-01 11:23:03 -05:00
<button class="btn btn-danger btn-xs" disabled="disabled">
<i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
</button>
{% else %}
<a href="{% url 'dcim:poweroutlet_delete' pk=po.pk %}?return_url={{ device.get_absolute_url }}" title="Delete outlet" class="btn btn-danger btn-xs">
<i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
2016-03-01 11:23:03 -05:00
</a>
{% endif %}
{% endif %}
</td>
</tr>