Spaces:
Sleeping
Sleeping
File size: 1,947 Bytes
4343907 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
/**
* SAAP Vue Router Configuration
* Navigation system for SAAP Multi-Agent Platform
*/
import { createRouter, createWebHistory } from 'vue-router'
import SaapDashboard from '@/components/SaapDashboard.vue'
import DashboardSimple from '@/views/DashboardSimple.vue'
import AgentDetails from '@/views/AgentDetails.vue'
import Settings from '@/views/Settings.vue'
import About from '@/views/About.vue'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: '/',
name: 'Dashboard',
component: SaapDashboard, // ✅ FIXED: Use SaapDashboard with beautiful card layout
meta: {
title: 'SAAP Dashboard',
requiresAuth: false
}
},
{
path: '/simple',
name: 'DashboardSimple',
component: DashboardSimple,
meta: {
title: 'SAAP Dashboard (Simple)',
requiresAuth: false
}
},
{
path: '/agents/:id',
name: 'AgentDetails',
component: AgentDetails,
props: true,
meta: {
title: 'Agent Details',
requiresAuth: false
}
},
{
path: '/settings',
name: 'Settings',
component: Settings,
meta: {
title: 'Settings',
requiresAuth: false
}
},
{
path: '/about',
name: 'About',
component: About,
meta: {
title: 'About SAAP',
requiresAuth: false
}
},
{
// Catch-all route for 404
path: '/:pathMatch(.*)*',
name: 'NotFound',
redirect: '/'
}
]
})
// Navigation Guards
router.beforeEach((to, from, next) => {
// Update document title
if (to.meta.title) {
document.title = `${to.meta.title} | SAAP Platform`
}
// Continue navigation
next()
})
router.afterEach((to, from) => {
// Log navigation for debugging
console.log(`🧭 Navigated from ${from.path} to ${to.path}`)
})
export default router
|