Merge "fix: Fix the system classsification of image"

This commit is contained in:
Zuul 2021-09-28 02:26:28 +00:00 committed by Gerrit Code Review
commit 22cf920129

View File

@ -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);