Files
NanoKVM-MIRROR/web/src/api/download.ts
watermeko 69f5da6fc7 feat(download): add sha256sum check and cancellable downloads
+ 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
2026-07-16 11:03:07 +00:00

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');
}