Can upload disk images on the server
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
31
virtweb_frontend/src/api/DiskImageApi.ts
Normal file
31
virtweb_frontend/src/api/DiskImageApi.ts
Normal file
@ -0,0 +1,31 @@
|
||||
import { APIClient } from "./ApiClient";
|
||||
|
||||
export interface DiskImage {}
|
||||
|
||||
export class DiskImageApi {
|
||||
/**
|
||||
* Upload a new disk image file to the server
|
||||
*/
|
||||
static async Upload(
|
||||
file: File,
|
||||
progress: (progress: number) => void
|
||||
): Promise<void> {
|
||||
const fd = new FormData();
|
||||
fd.append("file", file);
|
||||
|
||||
await APIClient.exec({
|
||||
method: "POST",
|
||||
uri: "/disk_images/upload",
|
||||
formData: fd,
|
||||
upProgress: progress,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of disk images
|
||||
*/
|
||||
static async GetList(): Promise<DiskImage[]> {
|
||||
// TODO
|
||||
return [];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user