fix: Check status of instance when attaching port

check status of instance when attaching port

Change-Id: I1eabd674b475f627ae4b70d21a6cfe2f87ef84ee
This commit is contained in:
zhuyue 2021-09-01 16:14:41 +08:00
parent cd917640eb
commit 62fa7f3dd1
2 changed files with 8 additions and 1 deletions

View File

@ -15,7 +15,10 @@
import { inject, observer } from 'mobx-react';
import { ModalAction } from 'containers/Action';
import globalServerStore, { ServerStore } from 'stores/nova/instance';
import { instanceSelectTablePropsBackend } from 'resources/instance';
import {
instanceSelectTablePropsBackend,
allowAttachInterfaceStatus,
} from 'resources/instance';
@inject('rootStore')
@observer
@ -85,6 +88,8 @@ export default class Attach extends ModalAction {
type: 'select-table',
backendPageStore: this.store,
extraParams: { noReminder: true },
disabledFunc: (item) =>
item.locked || !allowAttachInterfaceStatus.includes(item.vm_state),
required: true,
isMulti: false,
...instanceSelectTablePropsBackend,

View File

@ -574,3 +574,5 @@ export const actionColumn = (self) => {
},
];
};
export const allowAttachInterfaceStatus = ['active', 'paused', 'stopped'];