2019-02-20 14:34:05 -05:00
|
|
|
{% load helpers %}
|
|
|
|
|
2020-01-27 22:44:38 +00:00
|
|
|
<tr class="poweroutlet{% if po.cable %} {{ po.cable.get_status_class }}{% endif %}">
|
2018-10-26 11:29:03 -04:00
|
|
|
|
|
|
|
{# Checkbox #}
|
2017-11-03 16:58:56 -04:00
|
|
|
{% if perms.dcim.change_poweroutlet or perms.dcim.delete_poweroutlet %}
|
2016-07-26 10:14:51 -04:00
|
|
|
<td class="pk">
|
|
|
|
<input name="pk" type="checkbox" value="{{ po.pk }}" />
|
|
|
|
</td>
|
|
|
|
{% endif %}
|
2018-10-26 11:29:03 -04:00
|
|
|
|
|
|
|
{# 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>
|
2018-10-26 11:29:03 -04:00
|
|
|
|
2019-11-06 15:30:54 -05:00
|
|
|
{# Type #}
|
|
|
|
<td>
|
|
|
|
{{ po.get_type_display }}
|
|
|
|
</td>
|
|
|
|
|
2019-05-02 13:56:30 -04:00
|
|
|
{# Input/leg #}
|
2019-04-10 14:16:16 -04:00
|
|
|
<td>
|
|
|
|
{% if po.power_port %}
|
|
|
|
{{ po.power_port }}{% if po.feed_leg %} / {{ po.get_feed_leg_display }}{% endif %}
|
2019-05-02 13:56:30 -04:00
|
|
|
{% elif po.feed_leg %}
|
|
|
|
{{ po.get_feed_leg_display }}
|
2019-04-10 14:16:16 -04:00
|
|
|
{% else %}
|
|
|
|
<span class="text-warning">None</span>
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
|
2019-02-20 14:34:05 -05:00
|
|
|
{# Description #}
|
|
|
|
<td>
|
|
|
|
{{ po.description|placeholder }}
|
|
|
|
</td>
|
|
|
|
|
2018-10-26 13:21:43 -04:00
|
|
|
{# Cable #}
|
2019-06-20 13:58:32 -04:00
|
|
|
<td class="text-nowrap">
|
2018-10-29 12:24:16 -04:00
|
|
|
{% if po.cable %}
|
|
|
|
<a href="{{ po.cable.get_absolute_url }}">{{ po.cable }}</a>
|
2019-06-20 13:58:32 -04:00
|
|
|
<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>
|
2018-10-29 12:24:16 -04:00
|
|
|
{% else %}
|
2019-02-20 14:34:05 -05:00
|
|
|
<span class="text-muted">—</span>
|
2018-10-29 12:24:16 -04:00
|
|
|
{% endif %}
|
2018-10-26 13:21:43 -04:00
|
|
|
</td>
|
|
|
|
|
2018-10-26 11:29:03 -04:00
|
|
|
{# Connection #}
|
2018-10-24 11:00:13 -04:00
|
|
|
{% if po.connected_endpoint %}
|
2019-04-10 13:05:51 -04:00
|
|
|
{% 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 %}
|
2019-04-10 13:05:51 -04:00
|
|
|
<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 %}
|
2018-10-26 11:29:03 -04:00
|
|
|
|
|
|
|
{# Actions #}
|
2019-03-05 15:42:47 -06:00
|
|
|
<td class="text-right noprint">
|
2018-11-15 14:23:23 -05:00
|
|
|
{% 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">
|
2018-11-15 14:23:23 -05:00
|
|
|
<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 %}
|
2017-06-16 10:01:47 -04:00
|
|
|
<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 %}
|
2018-10-24 11:00:13 -04:00
|
|
|
{% 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 %}
|
2018-02-27 14:59:45 -05:00
|
|
|
<a href="{% url 'dcim:poweroutlet_delete' pk=po.pk %}?return_url={{ device.get_absolute_url }}" title="Delete outlet" class="btn btn-danger btn-xs">
|
2017-06-16 10:01:47 -04:00
|
|
|
<i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
|
2016-03-01 11:23:03 -05:00
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|