download list

This commit is contained in:
josc146
2023-05-20 13:00:08 +08:00
parent 4f8e35ce62
commit 0761df8df5
8 changed files with 104 additions and 12 deletions

View File

@@ -52,6 +52,17 @@ export type ModelConfig = {
modelParameters: ModelParameters
}
export type DownloadStatus = {
name: string;
path: string;
url: string;
transferred: number;
size: number;
speed: number;
progress: number;
done: boolean;
}
export const defaultModelConfigs: ModelConfig[] = [
{
name: 'Default',
@@ -91,6 +102,7 @@ class CommonStore {
};
introduction: { [lang: string]: string } = manifest.introduction;
about: { [lang: string]: string } = manifest.about;
downloadList: DownloadStatus[] = [];
getCurrentModelConfig = () => {
return this.modelConfigs[this.currentModelConfigIndex];
@@ -168,6 +180,10 @@ class CommonStore {
setAbout = (value: { [lang: string]: string }) => {
this.about = value;
};
setDownloadList = (value: DownloadStatus[]) => {
this.downloadList = value;
};
}
export default new CommonStore();