Refactor: Rename NanoKVM to BatchuKVM and update server URL
This commit is contained in:
32
web/src/api/storage.ts
Normal file
32
web/src/api/storage.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { http } from '@/lib/http.ts';
|
||||
|
||||
// get image list
|
||||
export function getImages() {
|
||||
return http.get('/api/storage/image');
|
||||
}
|
||||
|
||||
// get mounted image
|
||||
export function getMountedImage() {
|
||||
return http.get('/api/storage/image/mounted');
|
||||
}
|
||||
|
||||
// mount/unmount image
|
||||
export function mountImage(file?: string, cdrom?: boolean) {
|
||||
const data = {
|
||||
file: file ? file : '',
|
||||
cdrom: cdrom
|
||||
};
|
||||
return http.post('/api/storage/image/mount', data);
|
||||
}
|
||||
|
||||
// get CD-ROM flag
|
||||
export function getCdRom() {
|
||||
return http.get('/api/storage/cdrom');
|
||||
}
|
||||
|
||||
export function deleteImage(file: string) {
|
||||
const data = {
|
||||
file
|
||||
};
|
||||
return http.post('/api/storage/image/delete', data);
|
||||
}
|
||||
Reference in New Issue
Block a user