diff --git a/netbox/dcim/tables.py b/netbox/dcim/tables.py index b1aa6e57d..437daaf29 100644 --- a/netbox/dcim/tables.py +++ b/netbox/dcim/tables.py @@ -67,6 +67,19 @@ INTERFACE_TAGGED_VLANS = """ {% endfor %} """ +POWERFEED_CABLE = """ +{{ value }} + + + +""" + +POWERFEED_CABLETERMINATION = """ +{{ value.parent }} + +{{ value }} +""" + # # Regions @@ -977,6 +990,15 @@ class PowerFeedTable(BaseTable): max_utilization = tables.TemplateColumn( template_code="{{ value }}%" ) + cable = tables.TemplateColumn( + template_code=POWERFEED_CABLE, + orderable=False + ) + connection = tables.TemplateColumn( + accessor='get_cable_peer', + template_code=POWERFEED_CABLETERMINATION, + orderable=False + ) available_power = tables.Column( verbose_name='Available power (VA)' ) @@ -988,8 +1010,9 @@ class PowerFeedTable(BaseTable): model = PowerFeed fields = ( 'pk', 'name', 'power_panel', 'rack', 'status', 'type', 'supply', 'voltage', 'amperage', 'phase', - 'max_utilization', 'available_power', 'tags', + 'max_utilization', 'cable', 'connection', 'available_power', 'tags', ) default_columns = ( - 'pk', 'name', 'power_panel', 'rack', 'status', 'type', 'supply', 'voltage', 'amperage', 'phase', + 'pk', 'name', 'power_panel', 'rack', 'status', 'type', 'supply', 'voltage', 'amperage', 'phase', 'cable', + 'connection', ) diff --git a/netbox/templates/dcim/device.html b/netbox/templates/dcim/device.html index d66213a78..c06f86bf0 100644 --- a/netbox/templates/dcim/device.html +++ b/netbox/templates/dcim/device.html @@ -792,7 +792,6 @@ Draw Description Cable - Cable Termination Connection @@ -847,7 +846,6 @@ Input/Leg Description Cable - Cable Termination Connection diff --git a/netbox/templates/dcim/inc/poweroutlet.html b/netbox/templates/dcim/inc/poweroutlet.html index 38eb7b8a6..a6a0dd03e 100644 --- a/netbox/templates/dcim/inc/poweroutlet.html +++ b/netbox/templates/dcim/inc/poweroutlet.html @@ -44,11 +44,8 @@ - {% include 'dcim/inc/cabletermination.html' with termination=po.get_cable_peer %} {% else %} - - Not connected - + Not connected {% endif %} {# Connection #} diff --git a/netbox/templates/dcim/inc/powerport.html b/netbox/templates/dcim/inc/powerport.html index c5c18c093..125bc5445 100644 --- a/netbox/templates/dcim/inc/powerport.html +++ b/netbox/templates/dcim/inc/powerport.html @@ -40,11 +40,8 @@ - {% include 'dcim/inc/cabletermination.html' with termination=pp.get_cable_peer %} {% else %} - - Not connected - + Not connected {% endif %} {# Connection #} diff --git a/netbox/templates/dcim/powerpanel.html b/netbox/templates/dcim/powerpanel.html index 3cad8b5b3..46b386cf3 100644 --- a/netbox/templates/dcim/powerpanel.html +++ b/netbox/templates/dcim/powerpanel.html @@ -58,7 +58,7 @@ {% block content %}
-
+
Power Panel @@ -82,17 +82,17 @@
- {% include 'inc/custom_fields_panel.html' with obj=powerpanel %} - {% include 'extras/inc/tags_panel.html' with tags=powerpanel.tags.all url='dcim:powerpanel_list' %} {% plugin_left_page powerpanel %}
-
- {% include 'panel_table.html' with table=powerfeed_table heading='Connected Feeds' %} +
+ {% include 'inc/custom_fields_panel.html' with obj=powerpanel %} + {% include 'extras/inc/tags_panel.html' with tags=powerpanel.tags.all url='dcim:powerpanel_list' %} {% plugin_right_page powerpanel %}
+ {% include 'panel_table.html' with table=powerfeed_table heading='Connected Feeds' %} {% plugin_full_width_page powerpanel %}