diff --git a/netbox/vpn/choices.py b/netbox/vpn/choices.py index 3c38a9901..90ec1af07 100644 --- a/netbox/vpn/choices.py +++ b/netbox/vpn/choices.py @@ -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'), ] diff --git a/netbox/vpn/models/l2vpn.py b/netbox/vpn/models/l2vpn.py index 05d6ff4fb..7f43bf909 100644 --- a/netbox/vpn/models/l2vpn.py +++ b/netbox/vpn/models/l2vpn.py @@ -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: