mirror of
https://github.com/sipeed/NanoKVM.git
synced 2026-09-11 00:22:56 -05:00
+ server/proto/download.go + add DownloadImageReq and sha256 argument server/router/download.go + add cancel download router server/service/download/service.go + sha256 decode and check + remove HEAD request + cancel download
23 lines
513 B
TypeScript
23 lines
513 B
TypeScript
import { http } from '@/lib/http.ts';
|
|
|
|
// Download image
|
|
export function downloadImage(file?: string, sha256sum?: string) {
|
|
const data = {
|
|
file: file ?? '',
|
|
sha256sum: sha256sum ?? ''
|
|
};
|
|
return http.post('/api/download/image', data);
|
|
}
|
|
|
|
export function cancelDownloadImage() {
|
|
return http.post('/api/download/image/cancel');
|
|
}
|
|
|
|
export function statusImage() {
|
|
return http.get('/api/download/image/status');
|
|
}
|
|
|
|
export function imageEnabled() {
|
|
return http.get('/api/download/image/enabled');
|
|
}
|