feat: add task cancellation support
- Add CancelTask function to cancel running/waiting tasks - Add /api/cancelTask endpoint - Add cancel button in task list for running/waiting tasks - Check cancellation status during download and merge operations Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -71,4 +71,9 @@ type ActiveTask = {
|
||||
export const deleteTask = async (id: number) => {
|
||||
const res = await fetch(`/api/deleteTask?id=${id}`).then(res => res.json()) as ResJSON
|
||||
if (!res.success) throw new Error(res.message)
|
||||
}
|
||||
|
||||
export const cancelTask = async (id: number) => {
|
||||
const res = await fetch(`/api/cancelTask?id=${id}`).then(res => res.json()) as ResJSON
|
||||
if (!res.success) throw new Error(res.message)
|
||||
}
|
||||
Reference in New Issue
Block a user