From a373c91d2021086d4dd854986ec149c6fd566933 Mon Sep 17 00:00:00 2001 From: Abhimanyu Saharan Date: Wed, 8 Nov 2023 18:19:14 +0530 Subject: [PATCH] adds unit to the power port draw #13587 --- netbox/dcim/tables/devices.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/netbox/dcim/tables/devices.py b/netbox/dcim/tables/devices.py index 624eb579b13..6467f373bf5 100644 --- a/netbox/dcim/tables/devices.py +++ b/netbox/dcim/tables/devices.py @@ -466,6 +466,14 @@ class PowerPortTable(ModularDeviceComponentTable, PathEndpointTable): 'args': [Accessor('device_id')], } ) + maximum_draw = tables.TemplateColumn( + template_code='''{% if record.maximum_draw %}{{ record.maximum_draw }} W{% else %}—{% endif %}''', + verbose_name=_('Maximum draw') + ) + allocated_draw = tables.TemplateColumn( + template_code='''{% if record.allocated_draw %}{{ record.allocated_draw }} W{% else %}—{% endif %}''', + verbose_name=_('Allocated draw') + ) tags = columns.TagColumn( url_name='dcim:powerport_list' )