Feat: Add real-time progress and logging to data extractor
- Implement IPC event system for pushing progress updates from main to renderer - Add Zustand store for centralized extractor state management - Refactor useExtractor hook to use store pattern - Add chromium-bidi dependency and externalize Playwright for build compatibility - Show detailed logs during extraction (DB connection, order resolution, ERP login, data import)
This commit is contained in:
@@ -27,7 +27,23 @@ const api = {
|
||||
|
||||
// Extractor service
|
||||
extractor: {
|
||||
runExtractor: (input: ExtractorInput) => ipcRenderer.invoke('extractor:run', input)
|
||||
runExtractor: (input: ExtractorInput) => ipcRenderer.invoke('extractor:run', input),
|
||||
onProgress: (callback: (data: { message: string; progress: number }) => void) => {
|
||||
const subscription = (
|
||||
_event: Electron.IpcRendererEvent,
|
||||
data: { message: string; progress: number }
|
||||
) => callback(data)
|
||||
ipcRenderer.on('extractor:progress', subscription)
|
||||
return () => ipcRenderer.removeListener('extractor:progress', subscription)
|
||||
},
|
||||
onLog: (callback: (data: { level: string; message: string }) => void) => {
|
||||
const subscription = (
|
||||
_event: Electron.IpcRendererEvent,
|
||||
data: { level: string; message: string }
|
||||
) => callback(data)
|
||||
ipcRenderer.on('extractor:log', subscription)
|
||||
return () => ipcRenderer.removeListener('extractor:log', subscription)
|
||||
}
|
||||
},
|
||||
|
||||
// Cleaner service
|
||||
|
||||
Reference in New Issue
Block a user