mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 09:28:38 -06:00
dcim: fix tooltips in svg rack display
This commit is contained in:
parent
cdd7ed21ee
commit
469a088874
@ -395,13 +395,22 @@ class RackElevationHelperMixin:
|
|||||||
fill='black'
|
fill='black'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
link.set_desc('{} — {} ({}U) {} {}'.format(
|
||||||
|
device.device_role, device.device_type.display_name,
|
||||||
|
device.device_type.u_height, device.asset_tag or '', device.serial or ''
|
||||||
|
))
|
||||||
link.add(drawing.rect(start, end, fill='#{}'.format(color)))
|
link.add(drawing.rect(start, end, fill='#{}'.format(color)))
|
||||||
hex_color = '#{}'.format(foreground_color(color))
|
hex_color = '#{}'.format(foreground_color(color))
|
||||||
link.add(drawing.text(str(device), insert=text, fill=hex_color))
|
link.add(drawing.text(str(device), insert=text, fill=hex_color))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _draw_device_rear(drawing, device, start, end, text):
|
def _draw_device_rear(drawing, device, start, end, text):
|
||||||
drawing.add(drawing.rect(start, end, class_="blocked"))
|
rect = drawing.rect(start, end, class_="blocked")
|
||||||
|
rect.set_desc('{} — {} ({}U) {} {}'.format(
|
||||||
|
device.device_role, device.device_type.display_name,
|
||||||
|
device.device_type.u_height, device.asset_tag or '', device.serial or ''
|
||||||
|
))
|
||||||
|
drawing.add(rect)
|
||||||
drawing.add(drawing.text(str(device), insert=text))
|
drawing.add(drawing.text(str(device), insert=text))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
Loading…
Reference in New Issue
Block a user