fix: Check status of instance when attaching port
check status of instance when attaching port Change-Id: I1eabd674b475f627ae4b70d21a6cfe2f87ef84ee
This commit is contained in:
parent
cd917640eb
commit
62fa7f3dd1
@ -15,7 +15,10 @@
|
|||||||
import { inject, observer } from 'mobx-react';
|
import { inject, observer } from 'mobx-react';
|
||||||
import { ModalAction } from 'containers/Action';
|
import { ModalAction } from 'containers/Action';
|
||||||
import globalServerStore, { ServerStore } from 'stores/nova/instance';
|
import globalServerStore, { ServerStore } from 'stores/nova/instance';
|
||||||
import { instanceSelectTablePropsBackend } from 'resources/instance';
|
import {
|
||||||
|
instanceSelectTablePropsBackend,
|
||||||
|
allowAttachInterfaceStatus,
|
||||||
|
} from 'resources/instance';
|
||||||
|
|
||||||
@inject('rootStore')
|
@inject('rootStore')
|
||||||
@observer
|
@observer
|
||||||
@ -85,6 +88,8 @@ export default class Attach extends ModalAction {
|
|||||||
type: 'select-table',
|
type: 'select-table',
|
||||||
backendPageStore: this.store,
|
backendPageStore: this.store,
|
||||||
extraParams: { noReminder: true },
|
extraParams: { noReminder: true },
|
||||||
|
disabledFunc: (item) =>
|
||||||
|
item.locked || !allowAttachInterfaceStatus.includes(item.vm_state),
|
||||||
required: true,
|
required: true,
|
||||||
isMulti: false,
|
isMulti: false,
|
||||||
...instanceSelectTablePropsBackend,
|
...instanceSelectTablePropsBackend,
|
||||||
|
@ -574,3 +574,5 @@ export const actionColumn = (self) => {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const allowAttachInterfaceStatus = ['active', 'paused', 'stopped'];
|
||||||
|
Loading…
Reference in New Issue
Block a user