Show VM screenshot
This commit is contained in:
@ -103,6 +103,7 @@ export class APIClient {
|
||||
});
|
||||
|
||||
// Process response
|
||||
// JSON response
|
||||
if (res.headers.get("content-type") === "application/json")
|
||||
data = await res.json();
|
||||
// Binary file
|
||||
@ -146,7 +147,7 @@ export class APIClient {
|
||||
data = await resInt.blob();
|
||||
}
|
||||
|
||||
// Do not track progress
|
||||
// Do not track progress (binary file)
|
||||
else data = await res.blob();
|
||||
|
||||
status = res.status;
|
||||
|
@ -136,6 +136,18 @@ export class VMApi {
|
||||
).data.state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a screenshot of a VM
|
||||
*/
|
||||
static async Screenshot(vm: VMInfo): Promise<Blob> {
|
||||
return (
|
||||
await APIClient.exec({
|
||||
uri: `/vm/${vm.uuid}/screenshot`,
|
||||
method: "GET",
|
||||
})
|
||||
).data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the VM
|
||||
*/
|
||||
|
Reference in New Issue
Block a user