fix: 下载管理可以删除未在进行中的任务

This commit is contained in:
2026-10-25 07:37:09 +08:00
parent db8004c6bd
commit 7af439d40d
2 changed files with 45 additions and 3 deletions
+6
View File
@@ -35,6 +35,7 @@ export interface DownloadJob {
csvPath: string;
failures: { id: string; message: string }[];
createdAt: string;
stopping?: boolean;
}
export function loadMeta() {
@@ -72,6 +73,11 @@ export function pauseJob(id: string) {
return api<DownloadJob>(`/api/download/jobs/${id}/pause`, { method: "POST" });
}
export function deleteJob(id: string, files: boolean) {
const flag = files ? "true" : "false";
return api<unknown>(`/api/download/jobs/${encodeURIComponent(id)}?files=${flag}`, { method: "DELETE" });
}
export function loadDownloadSettings() {
return api<{ maxConcurrentJobs: number }>("/api/download/settings");
}