mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-05 15:44:28 +00:00
feat(upload): allow canceling in-progress upload tasks from sidebar (#511)
* feat(upload): allow canceling in-progress upload tasks from sidebar * fix(upload): resolve concurrent confirmation race and store counter issues on cancellation * fix(webui): immediately remove cancelled upload files from file list view
This commit is contained in:
@@ -75,6 +75,11 @@ export const abortUploadResponseSchema = z.object({
|
||||
})
|
||||
export type AbortUploadResponse = z.infer<typeof abortUploadResponseSchema>
|
||||
|
||||
export const cancelUploadTaskResponseSchema = z.object({
|
||||
success: z.boolean(),
|
||||
})
|
||||
export type CancelUploadTaskResponse = z.infer<typeof cancelUploadTaskResponseSchema>
|
||||
|
||||
export const confirmFileUploadRequestSchema = z.object({
|
||||
fileId: z.string(),
|
||||
errorMessage: z.string().optional(),
|
||||
@@ -87,6 +92,7 @@ export const taskInfoSchema = z.object({
|
||||
total: z.number(),
|
||||
uploaded: z.number(),
|
||||
createdAt: z.string(),
|
||||
status: z.enum(['pending', 'uploading', 'completed', 'failed']).optional(),
|
||||
})
|
||||
export type TaskInfo = z.infer<typeof taskInfoSchema>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user