feat: add task management and progress reporting
- Implemented task and subtask structures with progress tracking. - Added reporting functionality to log progress at various stages in hotel room status management scripts. - Created a task store to manage tasks and their states, including persistence to local storage. - Updated UI components to display task lists and handle task actions (retry, remove). - Removed deprecated TaskCard and TaskList components, replacing them with a new structure for better maintainability. - Enhanced script execution service to emit progress events for UI updates.
This commit is contained in:
9
global.d.ts
vendored
9
global.d.ts
vendored
@@ -48,6 +48,11 @@ declare global {
|
||||
return: void
|
||||
}
|
||||
|
||||
// 任务事件
|
||||
[IPC_EVENTS.TASK_PROGRESS]: { params: [payload: any]; return: void; }
|
||||
[IPC_EVENTS.TASK_STARTED]: { params: [payload: any]; return: void; }
|
||||
[IPC_EVENTS.TASK_COMPLETED]: { params: [payload: any]; return: void; }
|
||||
|
||||
// 主题事件
|
||||
[IPC_EVENTS.THEME_MODE_UPDATED]: {
|
||||
params: [isDark: boolean]
|
||||
@@ -157,6 +162,10 @@ declare global {
|
||||
},
|
||||
// 执行脚本
|
||||
executeScript: (options: any) => Promise<{success: boolean, error?: string}>,
|
||||
// 任务事件
|
||||
onTaskProgress: (cb: (payload: any) => void) => () => void;
|
||||
onTaskStarted: (cb: (payload: any) => void) => () => void;
|
||||
onTaskCompleted: (cb: (payload: any) => void) => () => void;
|
||||
// 打开渠道
|
||||
openChannel: (channels: any) => Promise<{success: boolean, error?: string}>,
|
||||
// 脚本管理
|
||||
|
||||
Reference in New Issue
Block a user