fix: Fix for status check of migrate & live migrate
fix for status check of migrate & live migrate Change-Id: Id28a1659f8004b657fad863413f83c3baea36c1e
This commit is contained in:
parent
205dc9c7ca
commit
74ee3ec2aa
@ -15,7 +15,12 @@
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import globalServerStore from 'stores/nova/instance';
|
||||
import { ModalAction } from 'containers/Action';
|
||||
import { isActive, isNotDeleting, isIronicInstance } from 'resources/instance';
|
||||
import {
|
||||
isActive,
|
||||
isNotDeleting,
|
||||
isIronicInstance,
|
||||
isPaused,
|
||||
} from 'resources/instance';
|
||||
import globalHypervisorStore from 'stores/nova/hypervisor';
|
||||
import globalComputeHostStore from 'stores/nova/compute-host';
|
||||
import { hypervisorColumns, hypervisorFilters } from 'resources/hypervisor';
|
||||
@ -98,7 +103,9 @@ export default class LiveMigrate extends ModalAction {
|
||||
|
||||
static allowed = (item) =>
|
||||
Promise.resolve(
|
||||
isActive(item) && isNotDeleting(item) && !isIronicInstance(item)
|
||||
(isActive(item) || isPaused(item)) &&
|
||||
isNotDeleting(item) &&
|
||||
!isIronicInstance(item)
|
||||
);
|
||||
|
||||
get formItems() {
|
||||
|
@ -15,7 +15,12 @@
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import globalServerStore from 'stores/nova/instance';
|
||||
import { ModalAction } from 'containers/Action';
|
||||
import { isActive, isNotDeleting, isIronicInstance } from 'resources/instance';
|
||||
import {
|
||||
isActive,
|
||||
isNotDeleting,
|
||||
isIronicInstance,
|
||||
isStopped,
|
||||
} from 'resources/instance';
|
||||
import globalHypervisorStore from 'stores/nova/hypervisor';
|
||||
import globalComputeHostStore from 'stores/nova/compute-host';
|
||||
import { hypervisorColumns, hypervisorFilters } from 'resources/hypervisor';
|
||||
@ -95,7 +100,9 @@ export default class LiveMigrate extends ModalAction {
|
||||
|
||||
static allowed = (item) =>
|
||||
Promise.resolve(
|
||||
isActive(item) && isNotDeleting(item) && !isIronicInstance(item)
|
||||
(isActive(item) || isStopped(item)) &&
|
||||
isNotDeleting(item) &&
|
||||
!isIronicInstance(item)
|
||||
);
|
||||
|
||||
get formItems() {
|
||||
|
@ -166,6 +166,10 @@ export const isShutOff = (item) => checkStatus(['shutoff'], item);
|
||||
|
||||
export const isActive = (item) => checkStatus(['active'], item);
|
||||
|
||||
export const isStopped = (item) => checkStatus(['stopped'], item);
|
||||
|
||||
export const isPaused = (item) => checkStatus(['paused'], item);
|
||||
|
||||
export const isNotError = (item) => !checkStatus(['error'], item);
|
||||
|
||||
export const isIsoInstance = (item) => {
|
||||
|
Loading…
Reference in New Issue
Block a user