feat: 完善登录保持、栅格下载和任务调度
This commit is contained in:
@@ -21,10 +21,14 @@ export interface DownloadJob {
|
||||
network: string;
|
||||
cityName: string;
|
||||
month: string;
|
||||
wholeCity?: boolean;
|
||||
listingDone?: boolean;
|
||||
discovered?: number;
|
||||
total: number;
|
||||
completed: number;
|
||||
failed: number;
|
||||
writtenRows: number;
|
||||
duplicateCount?: number;
|
||||
csvPath: string;
|
||||
failures: { id: string; message: string }[];
|
||||
createdAt: string;
|
||||
@@ -49,3 +53,18 @@ export function cancelJob(id: string) {
|
||||
export function resumeJob(id: string) {
|
||||
return api<DownloadJob>(`/api/download/jobs/${id}/resume`, { method: "POST" });
|
||||
}
|
||||
|
||||
export function pauseJob(id: string) {
|
||||
return api<DownloadJob>(`/api/download/jobs/${id}/pause`, { method: "POST" });
|
||||
}
|
||||
|
||||
export function loadDownloadSettings() {
|
||||
return api<{ maxConcurrentJobs: number }>("/api/download/settings");
|
||||
}
|
||||
|
||||
export function saveDownloadSettings(maxConcurrentJobs: number) {
|
||||
return api<{ maxConcurrentJobs: number }>("/api/download/settings", {
|
||||
method: "PUT",
|
||||
body: JSON.stringify({ maxConcurrentJobs }),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user