Skip to content

Commit 8ab71fd

Browse files
author
GitHub Assistant
committed
feat(notifications): add system notifications feature for task events
implement notification manager with singleton pattern add notification options configuration and i18n support integrate notifications for various task events including downloads and directory refresh update setting page to enable notification preferences
1 parent dc6d504 commit 8ab71fd

18 files changed

Lines changed: 496 additions & 59 deletions

File tree

src/common/publicData.js

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,14 @@ export const defaultSettingData = {
178178
// 启用分词计算任务
179179
enableSegmentationTask: false,
180180
powerSaveMode: true,
181+
// 系统通知
182+
notifications: [
183+
'downloadTaskCompleted',
184+
'downloadTaskFailed',
185+
'downloadTaskAllCompleted',
186+
'autoClearDownloadedTaskSuccess',
187+
'autoClearDownloadedTaskFailed'
188+
],
181189
/*** 壁纸类型 ***/
182190
wallpaperType: '',
183191
/*** 图片壁纸配置 ***/
@@ -888,3 +896,62 @@ export const keyboardShortcuts = [
888896
}
889897
}
890898
]
899+
900+
export const notificationsOptions = [
901+
{
902+
label: '刷新目录任务',
903+
name: 'autoRefreshDirectoryTask',
904+
locale: 'notificationsOptions.autoRefreshDirectoryTask',
905+
children: [
906+
{
907+
label: '任务成功',
908+
locale: 'notificationsOptions.autoRefreshDirectoryTaskSuccess',
909+
value: 'autoRefreshDirectoryTaskSuccess'
910+
},
911+
{
912+
label: '任务失败',
913+
locale: 'notificationsOptions.autoRefreshDirectoryTaskFailed',
914+
value: 'autoRefreshDirectoryTaskFailed'
915+
}
916+
]
917+
},
918+
{
919+
label: '下载任务',
920+
name: 'downloadTask',
921+
locale: 'notificationsOptions.downloadTask',
922+
children: [
923+
{
924+
label: '任务完成',
925+
locale: 'notificationsOptions.downloadTaskCompleted',
926+
value: 'downloadTaskCompleted'
927+
},
928+
{
929+
label: '任务失败',
930+
locale: 'notificationsOptions.downloadTaskFailed',
931+
value: 'downloadTaskFailed'
932+
},
933+
{
934+
label: '所有下载任务完成',
935+
locale: 'notificationsOptions.downloadTaskAllCompleted',
936+
value: 'downloadTaskAllCompleted'
937+
}
938+
]
939+
},
940+
{
941+
label: '自动清理任务',
942+
name: 'autoClearDownloadedTask',
943+
locale: 'notificationsOptions.autoClearDownloadedTask',
944+
children: [
945+
{
946+
label: '任务成功',
947+
locale: 'notificationsOptions.autoClearDownloadedTaskSuccess',
948+
value: 'autoClearDownloadedTaskSuccess'
949+
},
950+
{
951+
label: '任务失败',
952+
locale: 'notificationsOptions.autoClearDownloadedTaskFailed',
953+
value: 'autoClearDownloadedTaskFailed'
954+
}
955+
]
956+
}
957+
]

src/i18n/locale/lang/ar-SA.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"application": "إعدادات التطبيق",
4040
"explore": "إعدادات الاستكشاف",
4141
"function": "إعدادات الوظائف",
42+
"notifications": "إشعارات النظام",
4243
"wallpaper": "إعدادات الخلفيات",
4344
"switch": "تبديل الخلفيات",
4445
"localResource": "الموارد المحلية",
@@ -317,9 +318,16 @@
317318
"invalidIndex": "يرجى إدخال فهرس صالح",
318319
"indexOutOfRange": "الفهرس خارج النطاق",
319320
"indexTooLarge": "الفهرس كبير جداً",
321+
"autoRefreshDirectoryTask": "مهمة تحديث الدليل",
322+
"autoRefreshDirectoryTaskSuccess": "اكتملت مهمة تحديث الدليل بنجاح!",
323+
"autoRefreshDirectoryTaskFailed": "فشلت مهمة تحديث الدليل!",
320324
"downloadTask": "مهمة التحميل",
321-
"downloadTaskDone": "اكتملت مهمة التحميل!",
322-
"allDownloadTasksDone": "اكتملت جميع مهام التحميل!",
325+
"downloadTaskCompleted": "اكتملت مهمة التحميل!",
326+
"downloadTaskFailed": "فشلت مهمة التحميل!",
327+
"downloadTaskAllCompleted": "اكتملت جميع مهام التحميل!",
328+
"autoClearDownloadedTask": "مهمة تنظيف التحميلات التلقائي",
329+
"autoClearDownloadedTaskSuccess": "اكتملت مهمة تنظيف التحميلات التلقائي بنجاح!",
330+
"autoClearDownloadedTaskFailed": "فشلت مهمة تنظيف التحميلات التلقائي!",
323331
"conflictSystemShortcut": "هذا الاختصار مستخدم بالفعل من قبل النظام أو التطبيقات الأخرى!",
324332
"conflictAppShortcut": "هذا الاختصار مكرر داخل التطبيق!",
325333
"notEditableShortcut": "هذا الاختصار لا يدعم التعديل!",
@@ -480,6 +488,18 @@
480488
"left": "يسار",
481489
"center": "مركز"
482490
},
491+
"notificationsOptions": {
492+
"autoRefreshDirectoryTask": "مهمة تحديث الدليل",
493+
"autoRefreshDirectoryTaskSuccess": "مهمة ناجحة",
494+
"autoRefreshDirectoryTaskFailed": "فشلت المهمة",
495+
"downloadTask": "مهمة التحميل",
496+
"downloadTaskCompleted": "مهمة مكتملة",
497+
"downloadTaskFailed": "فشلت المهمة",
498+
"downloadTaskAllCompleted": "اكتملت جميع مهام التحميل",
499+
"autoClearDownloadedTask": "مهمة تنظيف تلقائي",
500+
"autoClearDownloadedTaskSuccess": "مهمة ناجحة",
501+
"autoClearDownloadedTaskFailed": "فشلت المهمة"
502+
},
483503
"wordTypeList": {
484504
"chinese": "中文",
485505
"english": "English"

src/i18n/locale/lang/de-DE.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"application": "Anwendungseinstellungen",
4040
"explore": "Erkundungseinstellungen",
4141
"function": "Funktionseinstellungen",
42+
"notifications": "Systembenachrichtigungen",
4243
"wallpaper": "Hintergrund-Einstellungen",
4344
"switch": "Hintergrund wechseln",
4445
"localResource": "Lokale Ressourcen",
@@ -317,9 +318,16 @@
317318
"invalidIndex": "Bitte geben Sie einen gültigen Index ein",
318319
"indexOutOfRange": "Index außerhalb des gültigen Bereichs",
319320
"indexTooLarge": "Index zu groß",
321+
"autoRefreshDirectoryTask": "Verzeichnisaktualisierungsaufgabe",
322+
"autoRefreshDirectoryTaskSuccess": "Verzeichnisaktualisierungsaufgabe erfolgreich!",
323+
"autoRefreshDirectoryTaskFailed": "Verzeichnisaktualisierungsaufgabe fehlgeschlagen!",
320324
"downloadTask": "Download-Aufgabe",
321-
"downloadTaskDone": "Download-Aufgabe abgeschlossen!",
322-
"allDownloadTasksDone": "Alle Download-Aufgaben abgeschlossen!",
325+
"downloadTaskCompleted": "Download-Aufgabe abgeschlossen!",
326+
"downloadTaskFailed": "Download-Aufgabe fehlgeschlagen!",
327+
"downloadTaskAllCompleted": "Alle Download-Aufgaben abgeschlossen!",
328+
"autoClearDownloadedTask": "Automatische Download-Bereinigung",
329+
"autoClearDownloadedTaskSuccess": "Automatische Download-Bereinigung erfolgreich!",
330+
"autoClearDownloadedTaskFailed": "Automatische Download-Bereinigung fehlgeschlagen!",
323331
"conflictSystemShortcut": "Dieses Tastenkürzel wird bereits vom System oder anderen Anwendungen verwendet!",
324332
"conflictAppShortcut": "Dieses Tastenkürzel ist innerhalb der Anwendung doppelt vorhanden!",
325333
"notEditableShortcut": "Dieses Tastenkürzel kann nicht bearbeitet werden!",
@@ -480,6 +488,18 @@
480488
"left": "Links",
481489
"center": "Zentriert"
482490
},
491+
"notificationsOptions": {
492+
"autoRefreshDirectoryTask": "Verzeichnisaktualisierungsaufgabe",
493+
"autoRefreshDirectoryTaskSuccess": "Aufgabe erfolgreich",
494+
"autoRefreshDirectoryTaskFailed": "Aufgabe fehlgeschlagen",
495+
"downloadTask": "Download-Aufgabe",
496+
"downloadTaskCompleted": "Aufgabe abgeschlossen",
497+
"downloadTaskFailed": "Aufgabe fehlgeschlagen",
498+
"downloadTaskAllCompleted": "Alle Download-Aufgaben abgeschlossen",
499+
"autoClearDownloadedTask": "Automatische Bereinigungsaufgabe",
500+
"autoClearDownloadedTaskSuccess": "Aufgabe erfolgreich",
501+
"autoClearDownloadedTaskFailed": "Aufgabe fehlgeschlagen"
502+
},
483503
"wordTypeList": {
484504
"chinese": "中文",
485505
"english": "English"

src/i18n/locale/lang/en-US.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"application": "Application settings",
4040
"explore": "Explore settings",
4141
"function": "Function settings",
42+
"notifications": "System notifications",
4243
"wallpaper": "Wallpaper settings",
4344
"switch": "Wallpaper switching",
4445
"localResource": "Local resources",
@@ -317,9 +318,16 @@
317318
"invalidIndex": "Please enter a valid index",
318319
"indexOutOfRange": "Index out of range",
319320
"indexTooLarge": "Index too large",
321+
"autoRefreshDirectoryTask": "Refresh directory task",
322+
"autoRefreshDirectoryTaskSuccess": "Refresh directory task successful!",
323+
"autoRefreshDirectoryTaskFailed": "Refresh directory task failed!",
320324
"downloadTask": "Download task",
321-
"downloadTaskDone": "Download task completed!",
322-
"allDownloadTasksDone": "All download tasks completed!",
325+
"downloadTaskCompleted": "Download task completed!",
326+
"downloadTaskFailed": "Download task failed!",
327+
"downloadTaskAllCompleted": "All download tasks completed!",
328+
"autoClearDownloadedTask": "Auto clear download task",
329+
"autoClearDownloadedTaskSuccess": "Auto clear download task successful!",
330+
"autoClearDownloadedTaskFailed": "Auto clear download task failed!",
323331
"conflictSystemShortcut": "This shortcut is already occupied by the system or other applications!",
324332
"conflictAppShortcut": "This shortcut is duplicated within the application!",
325333
"notEditableShortcut": "This shortcut does not support modification!",
@@ -480,6 +488,18 @@
480488
"left": "Left",
481489
"center": "Center"
482490
},
491+
"notificationsOptions": {
492+
"autoRefreshDirectoryTask": "Refresh directory task",
493+
"autoRefreshDirectoryTaskSuccess": "Task successful",
494+
"autoRefreshDirectoryTaskFailed": "Task failed",
495+
"downloadTask": "Download task",
496+
"downloadTaskCompleted": "Task completed",
497+
"downloadTaskFailed": "Task failed",
498+
"downloadTaskAllCompleted": "All download tasks completed",
499+
"autoClearDownloadedTask": "Auto clear task",
500+
"autoClearDownloadedTaskSuccess": "Task successful",
501+
"autoClearDownloadedTaskFailed": "Task failed"
502+
},
483503
"wordTypeList": {
484504
"chinese": "中文",
485505
"english": "English"

src/i18n/locale/lang/es-ES.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"application": "Configuración de la aplicación",
4040
"explore": "Configuración de exploración",
4141
"function": "Configuración de funciones",
42+
"notifications": "Notificaciones del sistema",
4243
"wallpaper": "Configuración de fondos de pantalla",
4344
"switch": "Cambio de fondo de pantalla",
4445
"localResource": "Recursos locales",
@@ -317,9 +318,16 @@
317318
"invalidIndex": "Por favor, introduzca un índice válido",
318319
"indexOutOfRange": "Índice fuera de rango",
319320
"indexTooLarge": "Índice demasiado grande",
321+
"autoRefreshDirectoryTask": "Tarea de actualización de directorio",
322+
"autoRefreshDirectoryTaskSuccess": "¡Tarea completada con éxito!",
323+
"autoRefreshDirectoryTaskFailed": "¡Tarea fallida!",
320324
"downloadTask": "Tarea de descarga",
321-
"downloadTaskDone": "¡Tarea de descarga completada!",
322-
"allDownloadTasksDone": "¡Todas las tareas de descarga completadas!",
325+
"downloadTaskCompleted": "¡Tarea de descarga completada!",
326+
"downloadTaskFailed": "¡Tarea de descarga fallida!",
327+
"downloadTaskAllCompleted": "¡Todas las tareas de descarga completadas!",
328+
"autoClearDownloadedTask": "Tarea de limpieza automática de descargas",
329+
"autoClearDownloadedTaskSuccess": "¡Tarea completada con éxito!",
330+
"autoClearDownloadedTaskFailed": "¡Tarea fallida!",
323331
"conflictSystemShortcut": "¡Este atajo ya está siendo utilizado por el sistema u otras aplicaciones!",
324332
"conflictAppShortcut": "¡Este atajo está duplicado dentro de la aplicación!",
325333
"notEditableShortcut": "¡Este atajo no se puede modificar!",
@@ -480,6 +488,18 @@
480488
"left": "Izquierda",
481489
"center": "Centro"
482490
},
491+
"notificationsOptions": {
492+
"autoRefreshDirectoryTask": "Tarea de actualización de directorio",
493+
"autoRefreshDirectoryTaskSuccess": "Tarea exitosa",
494+
"autoRefreshDirectoryTaskFailed": "Tarea fallida",
495+
"downloadTask": "Tarea de descarga",
496+
"downloadTaskCompleted": "Tarea completada",
497+
"downloadTaskFailed": "Tarea fallida",
498+
"downloadTaskAllCompleted": "Todas las tareas de descarga completadas",
499+
"autoClearDownloadedTask": "Tarea de limpieza automática",
500+
"autoClearDownloadedTaskSuccess": "Tarea exitosa",
501+
"autoClearDownloadedTaskFailed": "Tarea fallida"
502+
},
483503
"wordTypeList": {
484504
"chinese": "中文",
485505
"english": "English"

src/i18n/locale/lang/fr-FR.json

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"application": "Paramètres de l'application",
4040
"explore": "Paramètres d'exploration",
4141
"function": "Paramètres de fonction",
42+
"notifications": "Notifications système",
4243
"wallpaper": "Paramètres du fond d'écran",
4344
"switch": "Changement de fond d'écran",
4445
"localResource": "Ressources locales",
@@ -317,9 +318,16 @@
317318
"invalidIndex": "Veuillez saisir un index valide",
318319
"indexOutOfRange": "Index hors limites",
319320
"indexTooLarge": "Index trop grand",
320-
"downloadTask": "Télécharger une tâche",
321-
"downloadTaskDone": "Tâche de téléchargement terminée !",
322-
"allDownloadTasksDone": "Toutes les tâches de téléchargement terminées !",
321+
"autoRefreshDirectoryTask": "Tâche de rafraîchissement du dossier",
322+
"autoRefreshDirectoryTaskSuccess": "Tâche de rafraîchissement du dossier réussie !",
323+
"autoRefreshDirectoryTaskFailed": "Échec de la tâche de rafraîchissement du dossier !",
324+
"downloadTask": "Tâche de téléchargement",
325+
"downloadTaskCompleted": "Tâche de téléchargement terminée !",
326+
"downloadTaskFailed": "Échec de la tâche de téléchargement !",
327+
"downloadTaskAllCompleted": "Toutes les tâches de téléchargement terminées !",
328+
"autoClearDownloadedTask": "Tâche de nettoyage automatique des téléchargements",
329+
"autoClearDownloadedTaskSuccess": "Tâche de nettoyage automatique des téléchargements réussie !",
330+
"autoClearDownloadedTaskFailed": "Échec de la tâche de nettoyage automatique des téléchargements !",
323331
"conflictSystemShortcut": "Ce raccourci est déjà utilisé par le système ou d'autres applications !",
324332
"conflictAppShortcut": "Ce raccourci est dupliqué dans l'application !",
325333
"notEditableShortcut": "Ce raccourci ne peut pas être modifié !",
@@ -480,6 +488,18 @@
480488
"left": "À gauche",
481489
"center": "Centré"
482490
},
491+
"notificationsOptions": {
492+
"autoRefreshDirectoryTask": "Tâche de rafraîchissement du dossier",
493+
"autoRefreshDirectoryTaskSuccess": "Tâche réussie",
494+
"autoRefreshDirectoryTaskFailed": "Échec de la tâche",
495+
"downloadTask": "Tâche de téléchargement",
496+
"downloadTaskCompleted": "Tâche terminée",
497+
"downloadTaskFailed": "Échec de la tâche",
498+
"downloadTaskAllCompleted": "Toutes les tâches de téléchargement terminées",
499+
"autoClearDownloadedTask": "Tâche de nettoyage automatique",
500+
"autoClearDownloadedTaskSuccess": "Tâche réussie",
501+
"autoClearDownloadedTaskFailed": "Échec de la tâche"
502+
},
483503
"wordTypeList": {
484504
"chinese": "中文",
485505
"english": "English"

src/i18n/locale/lang/it-IT.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"application": "Impostazioni dell'applicazione",
4040
"explore": "Impostazioni di esplorazione",
4141
"function": "Impostazioni funzionali",
42+
"notifications": "Notifiche di sistema",
4243
"wallpaper": "Impostazioni degli sfondi",
4344
"switch": "Modifica sfondo",
4445
"localResource": "Risorse locali",
@@ -317,9 +318,16 @@
317318
"invalidIndex": "Per favore, inserisci un indice valido",
318319
"indexOutOfRange": "Indice fuori intervallo",
319320
"indexTooLarge": "Indice troppo grande",
321+
"autoRefreshDirectoryTask": "Attività di aggiornamento directory",
322+
"autoRefreshDirectoryTaskSuccess": "Attività completata con successo!",
323+
"autoRefreshDirectoryTaskFailed": "Attività fallita!",
320324
"downloadTask": "Attività di download",
321-
"downloadTaskDone": "Attività di download completata!",
322-
"allDownloadTasksDone": "Tutte le attività di download completate!",
325+
"downloadTaskCompleted": "Attività di download completata!",
326+
"downloadTaskFailed": "Attività di download fallita!",
327+
"downloadTaskAllCompleted": "Tutte le attività di download completate!",
328+
"autoClearDownloadedTask": "Attività di pulizia automatica download",
329+
"autoClearDownloadedTaskSuccess": "Attività completata con successo!",
330+
"autoClearDownloadedTaskFailed": "Attività fallita!",
323331
"conflictSystemShortcut": "Questa scorciatoia è già utilizzata dal sistema o da altre applicazioni!",
324332
"conflictAppShortcut": "Questa scorciatoia è duplicata nell'applicazione!",
325333
"notEditableShortcut": "Questa scorciatoia non può essere modificata!",
@@ -480,6 +488,18 @@
480488
"left": "Sinistra",
481489
"center": "Centro"
482490
},
491+
"notificationsOptions": {
492+
"autoRefreshDirectoryTask": "Attività di aggiornamento directory",
493+
"autoRefreshDirectoryTaskSuccess": "Attività riuscita",
494+
"autoRefreshDirectoryTaskFailed": "Attività fallita",
495+
"downloadTask": "Attività di download",
496+
"downloadTaskCompleted": "Attività completata",
497+
"downloadTaskFailed": "Attività fallita",
498+
"downloadTaskAllCompleted": "Tutte le attività di download completate",
499+
"autoClearDownloadedTask": "Attività di pulizia automatica",
500+
"autoClearDownloadedTaskSuccess": "Attività riuscita",
501+
"autoClearDownloadedTaskFailed": "Attività fallita"
502+
},
483503
"wordTypeList": {
484504
"chinese": "中文",
485505
"english": "English"

0 commit comments

Comments
 (0)