fix: use absolute asset paths and prevent route-level runtime navigation
Change vite base from './' to '/' so asset paths are absolute. With
relative paths, direct navigation to multi-segment URLs like
/runtime/app/instance resolved assets to /runtime/assets/ which 404'd.
Also fix sidebar navigation: clicking a route while on the runtime tab
no longer navigates to /runtime/{appId}/{routeId} (which the runtime
page interprets as an instanceId). It stays at /runtime/{appId}.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -640,8 +640,10 @@ function LayoutContent() {
|
||||
if (appMatch) {
|
||||
const [, sAppId, sRouteId] = appMatch;
|
||||
if (scope.tab === 'apps') {
|
||||
// Deployments tab: navigate to /apps/:appId
|
||||
navigate(`/apps/${sAppId}`, { state });
|
||||
} else if (scope.tab === 'runtime') {
|
||||
// Runtime tab has no route-level view — stay at app level
|
||||
navigate(`/runtime/${sAppId}`, { state });
|
||||
} else {
|
||||
navigate(sRouteId ? `/${scope.tab}/${sAppId}/${sRouteId}` : `/${scope.tab}/${sAppId}`, { state });
|
||||
}
|
||||
@@ -653,6 +655,8 @@ function LayoutContent() {
|
||||
const [, sAppId, sRouteId] = exchangeMatch;
|
||||
if (scope.tab === 'apps') {
|
||||
navigate(`/apps/${sAppId}`, { state });
|
||||
} else if (scope.tab === 'runtime') {
|
||||
navigate(`/runtime/${sAppId}`, { state });
|
||||
} else {
|
||||
navigate(sRouteId ? `/${scope.tab}/${sAppId}/${sRouteId}` : `/${scope.tab}/${sAppId}`, { state });
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ export default defineConfig({
|
||||
optimizeDeps: {
|
||||
include: ['swagger-ui-dist/swagger-ui-bundle'],
|
||||
},
|
||||
base: './',
|
||||
base: '/',
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user