mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
Fixes #3943: Prevent rack elevation links from opening new tabs/windows
This commit is contained in:
parent
f220b3f128
commit
0a1dd64b94
@ -3,6 +3,7 @@
|
||||
## Bug Fixes
|
||||
|
||||
* [#3941](https://github.com/netbox-community/netbox/issues/3941) - Fixed exception when attempting to assign IP to interface
|
||||
* [#3943](https://github.com/netbox-community/netbox/issues/3943) - Prevent rack elevation links from opening new tabs/windows
|
||||
* [#3944](https://github.com/netbox-community/netbox/issues/3944) - Fix AttributeError exception when viewing prefixes list
|
||||
|
||||
---
|
||||
|
@ -390,7 +390,9 @@ class RackElevationHelperMixin:
|
||||
color = device.device_role.color
|
||||
link = drawing.add(
|
||||
drawing.a(
|
||||
reverse('dcim:device', kwargs={'pk': device.pk}), fill='black'
|
||||
href=reverse('dcim:device', kwargs={'pk': device.pk}),
|
||||
target='_top',
|
||||
fill='black'
|
||||
)
|
||||
)
|
||||
link.add(drawing.rect(start, end, fill='#{}'.format(color)))
|
||||
@ -405,10 +407,13 @@ class RackElevationHelperMixin:
|
||||
@staticmethod
|
||||
def _draw_empty(drawing, rack, start, end, text, id_, face_id, class_):
|
||||
link = drawing.add(
|
||||
drawing.a('{}?{}'.format(
|
||||
reverse('dcim:device_add'),
|
||||
urlencode({'rack': rack.pk, 'site': rack.site.pk, 'face': face_id, 'position': id_})
|
||||
))
|
||||
drawing.a(
|
||||
href='{}?{}'.format(
|
||||
reverse('dcim:device_add'),
|
||||
urlencode({'rack': rack.pk, 'site': rack.site.pk, 'face': face_id, 'position': id_})
|
||||
),
|
||||
target='_top'
|
||||
)
|
||||
)
|
||||
link.add(drawing.rect(start, end, class_=class_))
|
||||
link.add(drawing.text("add device", insert=text, class_='add-device'))
|
||||
|
Loading…
Reference in New Issue
Block a user