1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Convert device rear ports list to table

This commit is contained in:
Jeremy Stretch
2020-10-16 15:33:39 -04:00
parent 68060cf9e9
commit e3f98a011c
5 changed files with 55 additions and 97 deletions

View File

@@ -1067,6 +1067,9 @@ class DeviceView(ObjectView):
# Rear ports
rearports = RearPort.objects.restrict(request.user, 'view').filter(device=device).prefetch_related('cable')
rearport_table = tables.DeviceRearPortTable(rearports, orderable=False)
if request.user.has_perm('dcim.change_rearport') or request.user.has_perm('dcim.delete_rearport'):
rearport_table.columns.show('pk')
# Device bays
devicebays = DeviceBay.objects.restrict(request.user, 'view').filter(device=device).prefetch_related(
@@ -1101,7 +1104,7 @@ class DeviceView(ObjectView):
'poweroutlet_table': poweroutlet_table,
'interfaces': interfaces,
'frontport_table': frontport_table,
'rearports': rearports,
'rearport_table': rearport_table,
'devicebays': devicebays,
'inventoryitems': inventoryitems,
'services': services,