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

101 lines
3.5 KiB
HTML
Raw Normal View History

{% load helpers %}
2020-01-27 22:44:38 +00:00
<tr class="poweroutlet{% if po.cable %} {{ po.cable.get_status_class }}{% 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>
2020-06-25 12:21:25 -04:00
<i class="fa fa-fw fa-bolt"></i>
<a href="{{ po.get_absolute_url }}">{{ po }}</a>
2016-03-01 11:23:03 -05:00
</td>
2019-11-06 15:30:54 -05:00
{# Type #}
<td>
{{ po.get_type_display }}
</td>
{# Input/leg #}
<td>
{% if po.power_port %}
{{ po.power_port }}{% if po.feed_leg %} / {{ po.get_feed_leg_display }}{% endif %}
{% elif po.feed_leg %}
{{ po.get_feed_leg_display }}
{% else %}
<span class="text-warning">None</span>
{% endif %}
</td>
{# Description #}
<td>
{{ po.description|placeholder }}
</td>
{# Cable #}
<td class="text-nowrap">
{% if po.cable %}
<a href="{{ po.cable.get_absolute_url }}">{{ po.cable }}</a>
<a href="{% url 'dcim:poweroutlet_trace' pk=po.pk %}" class="btn btn-primary btn-xs" title="Trace">
<i class="fa fa-share-alt" aria-hidden="true"></i>
</a>
{% else %}
<span class="text-muted">&mdash;</span>
{% endif %}
</td>
{# Connection #}
{% if po.connected_endpoint %}
{% with pp=po.connected_endpoint %}
<td>
<a href="{% url 'dcim:device' pk=pp.device.pk %}">{{ pp.device }}</a>
</td>
<td>
{{ pp }}
</td>
<td>
{% if pp.allocated_draw %}
{{ pp.allocated_draw }}W{% if pp.maximum_draw %} ({{ pp.maximum_draw }}W max){% endif %}
{% elif pp.maximum_draw %}
{{ pp.maximum_draw }}W
{% endif %}
</td>
{% endwith %}
2016-03-01 11:23:03 -05:00
{% else %}
<td colspan="3">
2016-07-06 16:01:18 -04:00
<span class="text-muted">Not connected</span>
</td>
2016-03-01 11:23:03 -05:00
{% endif %}
{# Actions #}
<td class="text-right noprint">
{% if po.cable %}
{% include 'dcim/inc/cable_toggle_buttons.html' with cable=po.cable %}
{% elif perms.dcim.add_cable %}
2019-06-17 16:32:21 -04:00
<a href="{% url 'dcim:poweroutlet_connect' termination_a_id=po.pk termination_b_type='power-port' %}?return_url={{ device.get_absolute_url }}" title="Connect" class="btn btn-success btn-xs">
<i class="glyphicon glyphicon-resize-small" aria-hidden="true"></i>
</a>
{% endif %}
2016-03-01 11:23:03 -05:00
{% if perms.dcim.change_poweroutlet %}
<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>