Can remove disks files from UI
This commit is contained in:
@ -27,6 +27,7 @@ export interface VMDisk {
|
||||
|
||||
// application attribute
|
||||
new?: boolean;
|
||||
deleteType?: "keepfile" | "deletefile";
|
||||
}
|
||||
|
||||
interface VMInfoInterface {
|
||||
@ -137,6 +138,12 @@ export class VMApi {
|
||||
* Update the information about a single VM
|
||||
*/
|
||||
static async UpdateSingle(vm: VMInfo): Promise<VMInfo> {
|
||||
// Process disks list, looking for removal
|
||||
vm.disks = vm.disks.filter((d) => d.deleteType !== "keepfile");
|
||||
vm.disks.forEach((d) => {
|
||||
if (d.deleteType === "deletefile") d.delete = true;
|
||||
});
|
||||
|
||||
const data = (
|
||||
await APIClient.exec({
|
||||
uri: `/vm/${vm.uuid!}`,
|
||||
|
Reference in New Issue
Block a user