Files
gohoarder/frontend/src/router/index.ts
T
lukaszraczylo 81e3f9c74f fix(frontend): show load failures as errors and add a not-found route
A failed request left the store error set while the view kept its own
empty-list branch, so the page said nothing was cached. Every view now
checks loading, then error, then content, and the retry button refetches.
Unknown paths render a NotFound page with a link to the dashboard. The brand
shares the sidebar left edge, and a stopped socket reads Live updates paused
in a neutral tone; the client already retries with backoff.
2026-11-23 02:29:14 +00:00

54 lines
1.4 KiB
TypeScript

import { createRouter, createWebHistory, type RouteRecordRaw, type RouterHistory } from 'vue-router'
export const routes: RouteRecordRaw[] = [
{
path: '/',
name: 'dashboard',
component: () => import('../components/Dashboard.vue'),
},
{
path: '/packages/:registry?',
name: 'packages',
component: () => import('../components/PackageList.vue'),
props: true,
},
{
// Separate route for package details - supports names with slashes (Go packages)
path: '/package/:registry/:name+/:version',
name: 'package-details',
component: () => import('../components/PackageDetails.vue'),
props: true,
},
{
path: '/stats',
name: 'stats',
component: () => import('../components/Stats.vue'),
},
{
path: '/vulnerable-packages',
name: 'vulnerable-packages',
component: () => import('../components/VulnerablePackages.vue'),
},
{
path: '/blocked-packages',
name: 'blocked-packages',
component: () => import('../components/VulnerablePackages.vue'),
},
{
path: '/admin/bypasses',
name: 'bypasses',
component: () => import('../components/BypassManagementPanel.vue'),
},
{
path: '/:pathMatch(.*)*',
name: 'not-found',
component: () => import('../components/NotFound.vue'),
},
]
export function createAppRouter(history: RouterHistory = createWebHistory()) {
return createRouter({ history, routes })
}
export default createAppRouter()