Include draw numbers of connected power ports

This commit is contained in:
Jeremy Stretch 2019-04-10 13:05:51 -04:00
parent 8230ea1c83
commit 0ddd71fc36
2 changed files with 17 additions and 8 deletions

View File

@ -629,7 +629,7 @@
<th>Name</th>
<th>Description</th>
<th>Cable</th>
<th colspan="2">Connection</th>
<th colspan="3">Connection</th>
<th></th>
</tr>
</thead>

View File

@ -30,14 +30,23 @@
{# Connection #}
{% if po.connected_endpoint %}
<td>
<a href="{% url 'dcim:device' pk=po.connected_endpoint.device.pk %}">{{ po.connected_endpoint.device }}</a>
</td>
<td>
{{ po.connected_endpoint }}
</td>
{% 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 %}
{% else %}
<td colspan="2">
<td colspan="3">
<span class="text-muted">Not connected</span>
</td>
{% endif %}