Clarify disk structures names
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2025-05-27 21:42:46 +02:00
parent 5a5450070a
commit 5814b0ab6a
4 changed files with 41 additions and 24 deletions

View File

@ -1,6 +1,16 @@
import { APIClient } from "./ApiClient";
export interface DiskImage {}
export type DiskImage = {
file_size: number;
file_name: string;
name: string;
created: number;
} & (
| { format: "Raw"; is_sparse: boolean }
| { format: "QCow2"; virtual_size: number }
| { format: "CompressedQCow2" }
| { format: "CompressedRaw" }
);
export class DiskImageApi {
/**
@ -25,7 +35,11 @@ export class DiskImageApi {
* Get the list of disk images
*/
static async GetList(): Promise<DiskImage[]> {
// TODO
return [];
return (
await APIClient.exec({
method: "GET",
uri: "/disk_images/list",
})
).data;
}
}

View File

@ -86,6 +86,7 @@ function UploadDiskImageCard(p: {
if (
newValue &&
newValue.type.length > 0 &&
!ServerApi.Config.disk_images_mimetypes.includes(newValue.type)
) {
alert(`Selected file mimetype is not allowed! (${newValue.type})`);