mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 17:38:37 -06:00
Fix CableTable status coloring
This commit is contained in:
parent
dc5f5efcfe
commit
790cfd7b5b
@ -3256,6 +3256,11 @@ class Cable(ChangeLoggedModel):
|
|||||||
'color', 'length', 'length_unit',
|
'color', 'length', 'length_unit',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
STATUS_CLASS_MAP = {
|
||||||
|
CableStatusChoices.STATUS_CONNECTED: 'success',
|
||||||
|
CableStatusChoices.STATUS_PLANNED: 'info',
|
||||||
|
}
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ['pk']
|
ordering = ['pk']
|
||||||
unique_together = (
|
unique_together = (
|
||||||
@ -3393,7 +3398,7 @@ class Cable(ChangeLoggedModel):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def get_status_class(self):
|
def get_status_class(self):
|
||||||
return 'success' if self.status else 'info'
|
return self.STATUS_CLASS_MAP.get(self.status)
|
||||||
|
|
||||||
def get_compatible_types(self):
|
def get_compatible_types(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user