mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-22 05:12:22 -06:00
12216 Add color to circuit-type and add to SVG rendering (#14098)
* 12216 add color to model * 12216 add forms, serializers for color * 12216 color to detail view, add type to svg * 12216 add color to svg * 12216 review changes
This commit is contained in:
@@ -159,6 +159,7 @@ class CableTraceSVG:
|
||||
labels.append(location_label)
|
||||
elif instance._meta.model_name == 'circuit':
|
||||
labels[0] = f'Circuit {instance}'
|
||||
labels.append(instance.type)
|
||||
labels.append(instance.provider)
|
||||
if instance.description:
|
||||
labels.append(instance.description)
|
||||
@@ -181,6 +182,8 @@ class CableTraceSVG:
|
||||
if hasattr(instance, 'role'):
|
||||
# Device
|
||||
return instance.role.color
|
||||
elif instance._meta.model_name == 'circuit' and instance.type.color:
|
||||
return instance.type.color
|
||||
else:
|
||||
# Other parent object
|
||||
return 'e0e0e0'
|
||||
|
||||
Reference in New Issue
Block a user