Relocate CSS classes for ChoiceFields from model to ChoiceSet

This commit is contained in:
Jeremy Stretch
2020-09-24 16:35:53 -04:00
parent a359d1b2be
commit db3a7e3b42
13 changed files with 114 additions and 114 deletions

View File

@@ -30,6 +30,13 @@ class PrefixStatusChoices(ChoiceSet):
(STATUS_DEPRECATED, 'Deprecated'),
)
CSS_CLASSES = {
STATUS_CONTAINER: 'default',
STATUS_ACTIVE: 'primary',
STATUS_RESERVED: 'info',
STATUS_DEPRECATED: 'danger',
}
#
# IPAddresses
@@ -51,6 +58,14 @@ class IPAddressStatusChoices(ChoiceSet):
(STATUS_SLAAC, 'SLAAC'),
)
CSS_CLASSES = {
STATUS_ACTIVE: 'primary',
STATUS_RESERVED: 'info',
STATUS_DEPRECATED: 'danger',
STATUS_DHCP: 'success',
STATUS_SLAAC: 'success',
}
class IPAddressRoleChoices(ChoiceSet):
@@ -74,6 +89,17 @@ class IPAddressRoleChoices(ChoiceSet):
(ROLE_CARP, 'CARP'),
)
CSS_CLASSES = {
ROLE_LOOPBACK: 'default',
ROLE_SECONDARY: 'primary',
ROLE_ANYCAST: 'warning',
ROLE_VIP: 'success',
ROLE_VRRP: 'success',
ROLE_HSRP: 'success',
ROLE_GLBP: 'success',
ROLE_CARP: 'success',
}
#
# VLANs
@@ -91,6 +117,12 @@ class VLANStatusChoices(ChoiceSet):
(STATUS_DEPRECATED, 'Deprecated'),
)
CSS_CLASSES = {
STATUS_ACTIVE: 'primary',
STATUS_RESERVED: 'info',
STATUS_DEPRECATED: 'danger',
}
#
# Services