-
- {{ user.name || user.username }}
-
-
- {{ item.label }}
-
+
+
+
+
+
+
+
+ {{ item.label }}
+
+
+ {{ item.description }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.label }}
+
+
+ {{ item.description }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.label }}
+
+
+ {{ item.description }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.badge }}
+
+
+
+
+ {{ item.label }}
+
+
+ {{ item.description }}
+
+
+
-
+
diff --git a/nuxt4-app/app/components/app/AppSidebar.vue b/nuxt4-app/app/components/app/AppSidebar.vue
index 7409786..adf410a 100644
--- a/nuxt4-app/app/components/app/AppSidebar.vue
+++ b/nuxt4-app/app/components/app/AppSidebar.vue
@@ -47,27 +47,182 @@
class="gap-1"
/>
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ user.name || user.username }}
+
+
+ {{ user.email }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Mi Perfil
+
+
+
+
+
+
+
+
+ Configuración
+
+
+
+
+
+
+
+
+
+ Notificaciones
+
+ 3
+
+
+
+
+
+
+
+
+
+
+ Cerrar sesión
+
+
+
+
+
+
+
+
+
+
+
@@ -127,18 +282,16 @@ const navigationPrimary = computed
(() => [
}
])
-const navigationSecondary: NavigationMenuItem[] = [
- {
- label: 'Documentación',
- icon: 'i-lucide-book-open',
- to: 'https://ui.nuxt.com',
- target: '_blank'
- },
- {
- label: 'Repositorio',
- icon: 'i-lucide-github',
- to: 'https://gitea.nucleoriofrio.com/nucleo000/analiticaNucleo',
- target: '_blank'
- }
-]
+const { user, loading, fetchUser, logout } = useAuth()
+
+// Cargar usuario al montar
+onMounted(() => {
+ fetchUser()
+})
+
+// Computed para el avatar del usuario
+const userAvatar = computed(() => ({
+ src: user.value?.avatar_url || `https://ui-avatars.com/api/?name=${encodeURIComponent(user.value?.name || user.value?.username || 'User')}&background=3b82f6&color=fff&bold=true&format=svg`,
+ alt: user.value?.name || user.value?.username || 'User'
+}))
diff --git a/nuxt4-app/app/composables/useAuth.ts b/nuxt4-app/app/composables/useAuth.ts
index 97e6ac3..a3e02ed 100644
--- a/nuxt4-app/app/composables/useAuth.ts
+++ b/nuxt4-app/app/composables/useAuth.ts
@@ -25,8 +25,18 @@ export const useAuth = () => {
}
const logout = () => {
- // Authentik maneja el logout, redirigir a la URL de logout
- window.location.href = '/outpost.goauthentik.io/sign_out'
+ // Limpiar estado local
+ user.value = null
+ loading.value = false
+
+ // Obtener configuración de Authentik desde variables de entorno
+ const config = useRuntimeConfig()
+ const authentikUrl = config.public.authentikUrl || 'https://authentik.nucleoriofrio.com'
+ const appSlug = config.public.authentikAppSlug || 'devserver'
+
+ // Redirigir al endpoint de logout de Authentik con el slug de la aplicación
+ // Esto cierra la sesión completa de Authentik (OIDC end-session)
+ window.location.href = `${authentikUrl}/application/o/${appSlug}/end-session/`
}
return {
diff --git a/nuxt4-app/app/error.vue b/nuxt4-app/app/error.vue
new file mode 100644
index 0000000..3e6a213
--- /dev/null
+++ b/nuxt4-app/app/error.vue
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ error.statusCode || '500' }}
+
+
+ {{ errorMessage.title }}
+
+
+ {{ errorMessage.description }}
+
+
+
+
+
+
+ {{ error.message }}
+
+
+
+
+
+
+ Ir al inicio
+
+
+ Intentar nuevamente
+
+
+
+
+
+
+
diff --git a/nuxt4-app/app/pages/notifications.vue b/nuxt4-app/app/pages/notifications.vue
new file mode 100644
index 0000000..f3a15bb
--- /dev/null
+++ b/nuxt4-app/app/pages/notifications.vue
@@ -0,0 +1,150 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Página en construcción
+
+
+ Estamos trabajando en esta funcionalidad
+
+
+ Pronto podrás gestionar tus notificaciones, configurar alertas personalizadas y mantenerte informado sobre eventos importantes del sistema.
+
+
+
+
+
+ Volver al inicio
+
+
+
+
+
+
+
+
+
+
+ Vista previa de notificaciones
+
+
+ {{ mockNotifications.filter(n => !n.read).length }} nuevas
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ notification.title }}
+
+
+ hace {{ notification.time }}
+
+
+
+ {{ notification.message }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/nuxt4-app/app/pages/profile.vue b/nuxt4-app/app/pages/profile.vue
new file mode 100644
index 0000000..b4999d6
--- /dev/null
+++ b/nuxt4-app/app/pages/profile.vue
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Página en construcción
+
+
+ Estamos trabajando en esta funcionalidad
+
+
+ Pronto podrás gestionar tu perfil, actualizar tu información personal, cambiar tu foto de perfil y más.
+
+
+
+
+
+ Volver al inicio
+
+
+
+
+
+
+
+
+
+ Información actual del usuario
+
+
+
+
+
+
+
+ {{ user.username || 'No especificado' }}
+
+
+
+
+
+
+ {{ user.name || 'No especificado' }}
+
+
+
+
+
+
+ {{ user.email || 'No especificado' }}
+
+
+
+
+
+
+
+
+
diff --git a/nuxt4-app/app/pages/settings.vue b/nuxt4-app/app/pages/settings.vue
new file mode 100644
index 0000000..9daa28f
--- /dev/null
+++ b/nuxt4-app/app/pages/settings.vue
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Página en construcción
+
+
+ Estamos trabajando en esta funcionalidad
+
+
+ Pronto podrás configurar tus preferencias de visualización, notificaciones, privacidad y más opciones del sistema.
+
+
+
+
+
+ Volver al inicio
+
+
+
+
+
+
+
+
+
+
+
+
+ Tema, colores y personalización visual
+
+
+
+
+
+
+
+
+
+
+ Notificaciones
+
+
+
+
+ Gestión de alertas y comunicaciones
+
+
+
+
+
+
+
+
+ Control de datos y seguridad
+
+
+
+
+
+
+
+
+
+
+ Idioma y región
+
+
+
+
+ Preferencias de localización
+
+
+
+
+
+
+
+
diff --git a/nuxt4-app/nuxt.config.ts b/nuxt4-app/nuxt.config.ts
index 66132aa..1e49b58 100644
--- a/nuxt4-app/nuxt.config.ts
+++ b/nuxt4-app/nuxt.config.ts
@@ -164,6 +164,10 @@ export default defineNuxtConfig({
url: process.env.SUPABASE_URL || process.env.NEXT_PUBLIC_SUPABASE_URL,
serviceRoleKey:
process.env.SUPABASE_SERVICE_ROLE_KEY || process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY
+ },
+ public: {
+ authentikUrl: process.env.NUXT_PUBLIC_AUTHENTIK_URL || '',
+ authentikAppSlug: process.env.NUXT_PUBLIC_AUTHENTIK_APP_SLUG || ''
}
}
})