mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
additional status choices for vms
This commit is contained in:
@@ -8,15 +8,19 @@ from utilities.choices import ChoiceSet
|
||||
|
||||
class VirtualMachineStatusChoices(ChoiceSet):
|
||||
|
||||
STATUS_ACTIVE = 'active'
|
||||
STATUS_OFFLINE = 'offline'
|
||||
STATUS_ACTIVE = 'active'
|
||||
STATUS_PLANNED = 'planned'
|
||||
STATUS_STAGED = 'staged'
|
||||
STATUS_FAILED = 'failed'
|
||||
STATUS_DECOMMISSIONING = 'decommissioning'
|
||||
|
||||
CHOICES = (
|
||||
(STATUS_ACTIVE, 'Active'),
|
||||
(STATUS_OFFLINE, 'Offline'),
|
||||
(STATUS_ACTIVE, 'Active'),
|
||||
(STATUS_PLANNED, 'Planned'),
|
||||
(STATUS_STAGED, 'Staged'),
|
||||
(STATUS_FAILED, 'Failed'),
|
||||
(STATUS_DECOMMISSIONING, 'Decommissioning'),
|
||||
)
|
||||
|
||||
|
@@ -267,9 +267,11 @@ class VirtualMachine(ChangeLoggedModel, ConfigContextModel, CustomFieldModel):
|
||||
]
|
||||
|
||||
STATUS_CLASS_MAP = {
|
||||
VirtualMachineStatusChoices.STATUS_OFFLINE: 'warning',
|
||||
VirtualMachineStatusChoices.STATUS_ACTIVE: 'success',
|
||||
VirtualMachineStatusChoices.STATUS_OFFLINE: 'danger',
|
||||
VirtualMachineStatusChoices.STATUS_PLANNED: 'info',
|
||||
VirtualMachineStatusChoices.STATUS_STAGED: 'primary',
|
||||
VirtualMachineStatusChoices.STATUS_FAILED: 'danger',
|
||||
VirtualMachineStatusChoices.STATUS_DECOMMISSIONING: 'warning',
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user