Show VM screenshot, if possible

This commit is contained in:
2024-05-06 19:39:21 +02:00
parent 31955ca738
commit d63d3ecebc
3 changed files with 86 additions and 2 deletions

View File

@ -86,4 +86,16 @@ export class VMApi {
static async ResetVM(vm: VMInfo): Promise<void> {
await APIClient.exec({ method: "GET", uri: `/vm/${vm.uiid}/reset` });
}
/**
* Get a screenshot of a VM
*/
static async Screenshot(vm: VMInfo): Promise<Blob> {
return (
await APIClient.exec({
uri: `/vm/${vm.uiid}/screenshot`,
method: "GET",
})
).data;
}
}