Add dynamic subpath support (#1011)
* Add dynamic subpath support for WebUI - Add SubpathConfig utility for server-side subpath detection - Configure React Router basename from server config - Update API base URL handling for subpath compatibility - Fix asset loading with relative paths - Add VITE_SUBPATH environment variable for development - Update locales and manifest paths for subpath support Closes #174 * Move VITE_SUBPATH interface to vite-env.d.ts * Ensure production bundle always uses relative base
This commit is contained in:
@@ -19,6 +19,7 @@ import { AppPageHistoryContextProvider } from '@/base/contexts/AppPageHistoryCon
|
||||
import { AppThemeContextProvider } from '@/features/theme/AppThemeContext.tsx';
|
||||
import { NavBarContextProvider } from '@/features/navigation-bar/NavbarContext.tsx';
|
||||
import { SessionContextProvider } from '@/features/authentication/SessionContext.tsx';
|
||||
import { SubpathConfig } from '@/lib/utils/SubpathConfig.ts';
|
||||
|
||||
interface Props {
|
||||
children: React.ReactNode;
|
||||
@@ -26,7 +27,7 @@ interface Props {
|
||||
|
||||
export const AppContext: React.FC<Props> = ({ children }) => (
|
||||
<SessionContextProvider>
|
||||
<Router>
|
||||
<Router basename={SubpathConfig.getRouterBasename()}>
|
||||
<StyledEngineProvider injectFirst>
|
||||
<AppThemeContextProvider>
|
||||
<QueryParamProvider adapter={ReactRouter6Adapter}>
|
||||
|
||||
Reference in New Issue
Block a user