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

Closes #4434: Enable highlighting devices within rack elevations

This commit is contained in:
jeremystretch
2022-06-24 11:04:38 -04:00
parent f9d81fd362
commit fc02e15fb1
10 changed files with 77 additions and 26 deletions

View File

@ -639,6 +639,11 @@ class RackView(generic.ObjectView):
device_count = Device.objects.restrict(request.user, 'view').filter(rack=instance).count()
# Determine any additional parameters to pass when embedding the rack elevations
svg_extra = '&'.join([
f'highlight=id:{pk}' for pk in request.GET.getlist('device')
])
return {
'device_count': device_count,
'reservations': reservations,
@ -646,6 +651,7 @@ class RackView(generic.ObjectView):
'nonracked_devices': nonracked_devices,
'next_rack': next_rack,
'prev_rack': prev_rack,
'svg_extra': svg_extra,
}