Add ISO catalog
This commit is contained in:
@ -5,6 +5,15 @@ export interface IsoFile {
|
||||
size: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* ISO catalog entries
|
||||
*/
|
||||
export interface ISOCatalogEntry {
|
||||
name: string;
|
||||
url: string;
|
||||
image: string;
|
||||
}
|
||||
|
||||
export class IsoFilesApi {
|
||||
/**
|
||||
* Upload a new ISO file to the server
|
||||
@ -74,4 +83,23 @@ export class IsoFilesApi {
|
||||
uri: `/iso/${file.filename}`,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get iso catalog
|
||||
*/
|
||||
static async Catalog(): Promise<ISOCatalogEntry[]> {
|
||||
return (
|
||||
await APIClient.exec({
|
||||
method: "GET",
|
||||
uri: "/assets/iso_catalog.json",
|
||||
})
|
||||
).data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get catalog image URL
|
||||
*/
|
||||
static CatalogImageURL(entry: ISOCatalogEntry): string {
|
||||
return APIClient.backendURL() + entry.image;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user