diff --git a/src/stores/glance/image.js b/src/stores/glance/image.js index 2002ee28..8d8ef868 100644 --- a/src/stores/glance/image.js +++ b/src/stores/glance/image.js @@ -15,6 +15,7 @@ import { action, observable } from 'mobx'; import client from 'client'; import Base from 'stores/base'; +import { imageOS } from 'resources/image'; export class ImageStore extends Base { @observable @@ -65,6 +66,17 @@ export class ImageStore extends Base { }; } + get mapper() { + return (data) => { + const { os_distro } = data; + const os = imageOS[os_distro] ? os_distro : 'others'; + return { + ...data, + os_distro: os, + }; + }; + } + @action async uploadImage(imageId, file, conf) { return this.client.uploadFile(imageId, file, conf);