chore: setup route

This commit is contained in:
Zephyruso 2023-09-04 13:08:05 +08:00
parent e357958d70
commit 880a40f18e
3 changed files with 8 additions and 4 deletions

View File

@ -32,7 +32,7 @@ export const App = () => {
onMount(() => {
if (!selectedEndpoint()) {
navigate('/setup')
navigate(ROUTES.Setup)
}
})
@ -56,7 +56,10 @@ export const App = () => {
<Route path="*" element={<Navigate href={ROUTES.Overview} />} />
</Show>
<Route path="/setup" component={Setup} />
<Route
path={selectedEndpoint() ? ROUTES.Setup : '*'}
component={Setup}
/>
</Routes>
</div>
</div>

View File

@ -119,7 +119,7 @@ export const Header = () => {
const onSwitchEndpointClick = () => {
setSelectedEndpoint('')
navigate('/setup')
navigate(ROUTES.Setup)
}
return (
@ -167,7 +167,7 @@ export const Header = () => {
</a>
</div>
<Show when={location.pathname !== '/setup'}>
<Show when={location.pathname !== ROUTES.Setup}>
<div class="navbar-center hidden lg:flex">
<ul class="menu menu-horizontal gap-2">
<For each={navs()}>

View File

@ -41,6 +41,7 @@ export enum ROUTES {
Conns = '/conns',
Log = '/logs',
Config = '/config',
Setup = '/setup',
}
export const CHART_MAX_XAXIS = 10