mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-20 04:12:25 -06:00
Relocate CSS classes for ChoiceFields from model to ChoiceSet
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user