mirror of
https://github.com/sipeed/NanoKVM.git
synced 2026-11-23 01:09:08 -06:00
28 lines
574 B
TypeScript
28 lines
574 B
TypeScript
import { http } from '@/lib/http.ts';
|
|
|
|
export function uploadScript(formData: FormData) {
|
|
return http.request({
|
|
url: '/api/vm/script/upload',
|
|
method: 'post',
|
|
headers: {
|
|
'Content-Type': 'multipart/form-data'
|
|
},
|
|
data: formData
|
|
});
|
|
}
|
|
|
|
export function runScript(name: string, type: string) {
|
|
return http.post('/api/vm/script/run', { name, type });
|
|
}
|
|
|
|
export function getScripts() {
|
|
return http.get('/api/vm/script');
|
|
}
|
|
|
|
export function deleteScript(name: string) {
|
|
const data = {
|
|
name
|
|
};
|
|
return http.delete('/api/vm/script', data);
|
|
}
|