Browse Source

Include draw numbers of connected power ports

Jeremy Stretch 6 years ago
parent
commit
0ddd71fc36
2 changed files with 17 additions and 8 deletions
  1. 1 1
      netbox/templates/dcim/device.html
  2. 16 7
      netbox/templates/dcim/inc/poweroutlet.html

+ 1 - 1
netbox/templates/dcim/device.html

@@ -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>

+ 16 - 7
netbox/templates/dcim/inc/poweroutlet.html

@@ -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 %}