This commit is contained in:
		@@ -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;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -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})`);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user