You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed that whenever I create a device type using an image that is slightly smaller, the background is coloured after the device role. But to me, looks better with a transparent background. I found a way around it, by changing a little the code in netbox/dcim/svg/racks.py:176
Instead of:
# Add rect element to hyperlink
if color:
link.add(Rect(coords, size, style=f'fill: #{color}', class_=f'slot{css_extra}'))
else:
link.add(Rect(coords, size, class_=f'slot blocked{css_extra}'))
link.add(Text(name, insert=text_coords, fill=text_color, class_=f'label{css_extra}'))
I changed to:
# Add rect element to hyperlink
if color and image:
link.add(Rect(coords, size, style=f'fill: None', class_=f'slot{css_extra}'))
elif color and not image:
link.add(Rect(coords, size, style=f'fill: #{color}', class_=f'slot{css_extra}'))
else:
link.add(Rect(coords, size, class_=f'slot blocked{css_extra}'))
link.add(Text(name, insert=text_coords, fill=text_color, class_=f'label{css_extra}'))
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I've noticed that whenever I create a device type using an image that is slightly smaller, the background is coloured after the device role. But to me, looks better with a transparent background. I found a way around it, by changing a little the code in netbox/dcim/svg/racks.py:176
Instead of:
I changed to:
By doing this, I went from this:


To this:


Beta Was this translation helpful? Give feedback.
All reactions