mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-11-26 06:37:07 +00:00
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.
54 lines
1.4 KiB
TypeScript
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()
|