Fix: fix the image store in magnum node spec
fix the image store to get better extensions Change-Id: Ia0256668b0dbcd4dad31048b36929a99205707ed
This commit is contained in:
parent
463ced2667
commit
72b81c645e
@ -15,7 +15,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { inject, observer } from 'mobx-react';
|
import { inject, observer } from 'mobx-react';
|
||||||
import Base from 'components/Form';
|
import Base from 'components/Form';
|
||||||
import globalImageStore from 'stores/glance/image';
|
import { ImageStore } from 'stores/glance/image';
|
||||||
import globalKeypairStore from 'stores/nova/keypair';
|
import globalKeypairStore from 'stores/nova/keypair';
|
||||||
import FlavorSelectTable from 'pages/compute/containers/Instance/components/FlavorSelectTable';
|
import FlavorSelectTable from 'pages/compute/containers/Instance/components/FlavorSelectTable';
|
||||||
import { getImageColumns } from 'resources/glance/image';
|
import { getImageColumns } from 'resources/glance/image';
|
||||||
@ -23,6 +23,7 @@ import { getKeyPairHeader } from 'resources/nova/keypair';
|
|||||||
|
|
||||||
export class StepNodeSpec extends Base {
|
export class StepNodeSpec extends Base {
|
||||||
init() {
|
init() {
|
||||||
|
this.imageStore = new ImageStore();
|
||||||
this.keyPairStore = globalKeypairStore;
|
this.keyPairStore = globalKeypairStore;
|
||||||
this.getImageList();
|
this.getImageList();
|
||||||
this.getKeypairs();
|
this.getKeypairs();
|
||||||
@ -45,7 +46,7 @@ export class StepNodeSpec extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getImageList() {
|
async getImageList() {
|
||||||
await globalImageStore.fetchList({ all_projects: this.hasAdminRole });
|
await this.imageStore.fetchList({ all_projects: this.hasAdminRole });
|
||||||
this.updateDefaultValue();
|
this.updateDefaultValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,7 +76,7 @@ export class StepNodeSpec extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get imageList() {
|
get imageList() {
|
||||||
return (globalImageStore.list.data || []).filter((it) => {
|
return (this.imageStore.list.data || []).filter((it) => {
|
||||||
const { originData: { os_distro } = {} } = it;
|
const { originData: { os_distro } = {} } = it;
|
||||||
return this.acceptedImageOs.includes(os_distro);
|
return this.acceptedImageOs.includes(os_distro);
|
||||||
});
|
});
|
||||||
@ -158,7 +159,7 @@ export class StepNodeSpec extends Base {
|
|||||||
type: 'select-table',
|
type: 'select-table',
|
||||||
data: this.imageList,
|
data: this.imageList,
|
||||||
required: true,
|
required: true,
|
||||||
isLoading: globalImageStore.list.isLoading,
|
isLoading: this.imageStore.list.isLoading,
|
||||||
filterParams: [
|
filterParams: [
|
||||||
{
|
{
|
||||||
label: t('Name'),
|
label: t('Name'),
|
||||||
|
Loading…
Reference in New Issue
Block a user