feat(export): show and stop background page tasks

This commit is contained in:
aits2026
2026-03-06 19:16:07 +08:00
parent 5affd4e57b
commit ecd64f62bc
10 changed files with 883 additions and 4 deletions

View File

@@ -0,0 +1,46 @@
export type BackgroundTaskSourcePage =
| 'export'
| 'chat'
| 'analytics'
| 'sns'
| 'groupAnalytics'
| 'annualReport'
| 'other'
export type BackgroundTaskStatus =
| 'running'
| 'cancel_requested'
| 'completed'
| 'failed'
| 'canceled'
export interface BackgroundTaskRecord {
id: string
sourcePage: BackgroundTaskSourcePage
title: string
detail?: string
progressText?: string
cancelable: boolean
cancelRequested: boolean
status: BackgroundTaskStatus
startedAt: number
updatedAt: number
finishedAt?: number
}
export interface BackgroundTaskInput {
sourcePage: BackgroundTaskSourcePage
title: string
detail?: string
progressText?: string
cancelable?: boolean
onCancel?: () => void | Promise<void>
}
export interface BackgroundTaskUpdate {
title?: string
detail?: string
progressText?: string
status?: BackgroundTaskStatus
cancelable?: boolean
}