Add ISO catalog

This commit is contained in:
2025-05-21 20:28:46 +02:00
parent 35e7f4b59c
commit 8c27010396
12 changed files with 308 additions and 19 deletions

View File

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