Skip to content

fix(web): redirect legacy dashboard routes to the SPA routes - #471

Open
yyyr-p wants to merge 7 commits into
Menci:mainfrom
yyyr-p:fix/legacy-dashboard-redirects
Open

fix(web): redirect legacy dashboard routes to the SPA routes#471
yyyr-p wants to merge 7 commits into
Menci:mainfrom
yyyr-p:fix/legacy-dashboard-redirects

Conversation

@yyyr-p

@yyyr-p yyyr-p commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

The dashboard was rebuilt as a React SPA, which moved several routes. Previously bookmarked paths such as /dashboard/keys, /dashboard/requests/:keyId, and /dashboard/upstreams/:id now fall through to the framework 404 page. This adds client-side redirects from the legacy Vue-era paths to their SPA equivalents.

  • Add apps/web/src/lib/legacy-redirects.ts, a pure matcher that maps legacy absolute paths — including dynamic params and the old #record-id hash — to new SPA URLs.
  • Register the legacy paths in routes.ts, generating the routes from the rule table so a new mapping only requires a table entry.
  • /dashboard/requests/:keyId carries the key over as ?key=, and the old record-selection hash is forwarded as ?record=.
  • A thin clientLoader on apps/web/src/routes/legacy-redirects.ts issues the redirect (302) or 404s.

Legacy → new:

legacy new
/login /
/dashboard/keys /dashboard/services/api-keys
/dashboard/models /dashboard/playground
/dashboard/performance /dashboard/monitor/performance
/dashboard/requests /dashboard/monitor/requests
/dashboard/requests/:keyId /dashboard/monitor/requests?key=:keyId
/dashboard/upstreams /dashboard/providers/upstreams
/dashboard/upstreams/new[:provider] /dashboard/providers/upstreams/new[:provider]
/dashboard/upstreams/:id /dashboard/providers/upstreams/:id
/dashboard/usage /dashboard/monitor/usage
/dashboard/users /dashboard/admin/users

Test Plan

  • New apps/web/__tests__/lib/legacy-redirects_test.ts covers static mappings, dynamic params, record-hash forwarding, trailing slashes, and unknown paths.
  • pnpm --filter @floway-dev/web run typecheck
  • pnpm --filter @floway-dev/web run build
  • ESLint on changed files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant