1
0
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:
kobayashi
2020-02-12 22:43:40 -05:00
parent bc7f5fb33a
commit 335343642b
3 changed files with 10 additions and 4 deletions

View File

@ -5,11 +5,11 @@
* [#3766](https://github.com/netbox-community/netbox/issues/3766) - Allow custom script authors to specify the form widget for each variable
* [#3799](https://github.com/netbox-community/netbox/issues/3799) - Greatly improve performance when ordering device components
* [#3986](https://github.com/netbox-community/netbox/issues/3986) - Include position numbers in SVG image when rendering rack elevation
* [#4093](https://github.com/netbox-community/netbox/issues/4093) - Add multiple status choices for VMs
* [#4100](https://github.com/netbox-community/netbox/issues/4100) - Add device filter to component list views
* [#4113](https://github.com/netbox-community/netbox/issues/4113) - Add bulk edit functionality for device type components
* [#4116](https://github.com/netbox-community/netbox/issues/4116) - Enable bulk edit and delete functions for device component list views
* [#4129](https://github.com/netbox-community/netbox/issues/4129) - Add buttons to delete individual device type components
* [#4093](https://github.com/netbox-community/netbox/issues/4093) - Add decommissioning status for VMs
## Bug Fixes

View File

@ -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'),
)

View File

@ -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',
}