mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 10:58:37 -06:00
Adds color definitions to L2VPNStatusChoices
This commit is contained in:
parent
2fb16f969e
commit
a2f3ad3479
@ -277,7 +277,7 @@ class L2VPNStatusChoices(ChoiceSet):
|
||||
STATUS_DECOMMISSIONED = 'decommissioned'
|
||||
|
||||
CHOICES = [
|
||||
(STATUS_PLANNED, _('Planned')),
|
||||
(STATUS_ACTIVE, _('Active')),
|
||||
(STATUS_DECOMMISSIONED, _('Decommissioned')),
|
||||
(STATUS_PLANNED, _('Planned'), 'cyan'),
|
||||
(STATUS_ACTIVE, _('Active'), 'green'),
|
||||
(STATUS_DECOMMISSIONED, _('Decommissioned'), 'red'),
|
||||
]
|
||||
|
@ -74,6 +74,9 @@ class L2VPN(ContactsMixin, PrimaryModel):
|
||||
return f'{self.name} ({self.identifier})'
|
||||
return f'{self.name}'
|
||||
|
||||
def get_status_color(self):
|
||||
return L2VPNStatusChoices.colors.get(self.status)
|
||||
|
||||
@cached_property
|
||||
def can_add_termination(self):
|
||||
if self.type in L2VPNTypeChoices.P2P and self.terminations.count() >= 2:
|
||||
|
Loading…
Reference in New Issue
Block a user