feat: Refactor rebuild instance
Refactor rebuild instance Change-Id: Idd8367d66a2c6363a3f24870f2e0eb2730375d06
This commit is contained in:
parent
07b381395c
commit
6118976855
@ -12,7 +12,6 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import { inject, observer } from 'mobx-react';
|
import { inject, observer } from 'mobx-react';
|
||||||
import globalImageStore from 'stores/glance/image';
|
import globalImageStore from 'stores/glance/image';
|
||||||
import globalServerStore from 'stores/nova/instance';
|
import globalServerStore from 'stores/nova/instance';
|
||||||
@ -22,11 +21,11 @@ import {
|
|||||||
isNotLocked,
|
isNotLocked,
|
||||||
isIsoInstance,
|
isIsoInstance,
|
||||||
} from 'resources/instance';
|
} from 'resources/instance';
|
||||||
import ImageType from 'components/ImageType';
|
|
||||||
import {
|
import {
|
||||||
getImageOS,
|
getImageOS,
|
||||||
getImageColumns,
|
getImageColumns,
|
||||||
canImageCreateInstance,
|
canImageCreateInstance,
|
||||||
|
getImageSystemTabs,
|
||||||
} from 'resources/image';
|
} from 'resources/image';
|
||||||
|
|
||||||
export class Rebuild extends ModalAction {
|
export class Rebuild extends ModalAction {
|
||||||
@ -77,28 +76,7 @@ export class Rebuild extends ModalAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get systemTabs() {
|
get systemTabs() {
|
||||||
const valueList = [
|
return getImageSystemTabs();
|
||||||
'centos',
|
|
||||||
'ubuntu',
|
|
||||||
'fedora',
|
|
||||||
'windows',
|
|
||||||
'debian',
|
|
||||||
'coreos',
|
|
||||||
'arch',
|
|
||||||
'freebsd',
|
|
||||||
'others',
|
|
||||||
];
|
|
||||||
return valueList.map((value) => {
|
|
||||||
const label =
|
|
||||||
value !== 'others'
|
|
||||||
? value.slice(0, 1).toUpperCase() + value.slice(1)
|
|
||||||
: t('Others');
|
|
||||||
return {
|
|
||||||
label,
|
|
||||||
value,
|
|
||||||
component: <ImageType type={value} title={value} />,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get defaultValue() {
|
get defaultValue() {
|
||||||
|
Loading…
Reference in New Issue
Block a user