feat(organize): worker thread + badges statut + notifications
- api: /api/organize/recent pour les notifications frontend - api: /api/system pour détecter l'environnement Docker - ui: badge organisation (NON ORGANISÉ / EN COURS / ORGANISÉ) dans DownloadsView - ui: icône download avec compteur actifs dans le header CatalogView - ui: toast automatique quand l'auto-organisation se termine - ui: paths en lecture seule avec badge DOCKER dans SettingsView
This commit is contained in:
1 parent
c097cd4d1f
commit
97da422037
5 files changed
+187
-36
No files matched your search
+9
-1
@@ -24,7 +24,8 @@ export interface OrganizeResult {
|
||||
* puis les données sont passées au worker.
|
||||
*/
|
||||
export async function autoOrganizeAll(
|
||||
listFn: () => Promise<any[]>
|
||||
listFn : () => Promise<any[]>,
|
||||
onResult?: (r: { hash: string; name: string; done: number; skipped: number; errors: number }) => void
|
||||
): Promise<void> {
|
||||
if (workerRunning) {
|
||||
console.log('[organize] Worker déjà en cours, skip')
|
||||
@@ -58,6 +59,13 @@ export async function autoOrganizeAll(
|
||||
else console.log(msg.msg)
|
||||
} else if (msg.type === 'result') {
|
||||
console.log(`[organize] ${msg.name} → ${msg.done} OK, ${msg.skipped} skippés, ${msg.errors.length} erreurs`)
|
||||
onResult?.({
|
||||
hash : msg.hash,
|
||||
name : msg.name,
|
||||
done : msg.done,
|
||||
skipped: msg.skipped,
|
||||
errors : msg.errors.length,
|
||||
})
|
||||
} else if (msg.type === 'done') {
|
||||
console.log('[organize] Worker terminé')
|
||||
workerRunning = false
|
||||
|
||||
Reference in new issue
Block a user