Feat: Implementar sistema de notificaciones con historial por usuario
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 48s
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 48s
- Crear composable useNotifications con gestión por localStorage - Almacenamiento separado por usuario usando UID de Authentik - Auto-limpieza de notificaciones mayores a 30 días - Sincronización automática entre pestañas - Filtrado por tipo, búsqueda y gestión completa - Crear wrapper useToast para guardar toasts automáticamente - Intercepta todos los toasts de la aplicación - Guarda historial sin afectar funcionalidad existente - Implementar endpoints de API para notificaciones del backend - POST /api/notifications/send para enviar notificaciones - GET /api/notifications/list para obtener pendientes - Actualizar página de notificaciones con funcionalidad real - Búsqueda y filtros por tipo (info, warning, success, error) - Eliminar individual o todas las notificaciones - Marcar como leídas individual o todas - Badges de origen (toast, backend, manual) - Estados vacíos con mensajes informativos - Actualizar badge del sidebar con contador dinámico - Muestra número real de notificaciones no leídas - Se oculta cuando no hay notificaciones - Inicializar sistema en app.vue - Auto-inicialización al montar la app - Limpieza automática de notificaciones antiguas
This commit is contained in:
@@ -13,6 +13,9 @@
|
||||
// Inicializar sistema de temas
|
||||
const { loadTheme, initStorageListener, cleanupStorageListener } = useTheme()
|
||||
|
||||
// Inicializar sistema de notificaciones
|
||||
const { initialize: initNotifications, cleanupOldNotifications } = useNotifications()
|
||||
|
||||
// Signal that the app is ready
|
||||
onMounted(() => {
|
||||
// Cargar tema guardado (o aplicar el por defecto)
|
||||
@@ -21,6 +24,12 @@ onMounted(() => {
|
||||
// Inicializar sincronización de tema entre pestañas
|
||||
initStorageListener()
|
||||
|
||||
// Inicializar sistema de notificaciones
|
||||
initNotifications()
|
||||
|
||||
// Limpiar notificaciones antiguas (> 30 días)
|
||||
cleanupOldNotifications()
|
||||
|
||||
// Add class to HTML element to hide loading screen
|
||||
if (process.client) {
|
||||
// Small delay to ensure everything is painted
|
||||
|
||||
Reference in New Issue
Block a user