Skip to content

Commit

Permalink
feat: redirect illegal path to overview (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
PuerNya committed Aug 30, 2023
1 parent 91e8984 commit a114b35
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Route, Routes, useNavigate } from '@solidjs/router'
import { Navigate, Route, Routes, useNavigate } from '@solidjs/router'
import { Show, lazy, onMount } from 'solid-js'
import { Header } from '~/components/Header'
import { curTheme, selectedEndpoint } from '~/signals'
Expand Down Expand Up @@ -30,12 +30,13 @@ export const App = () => {
<div class="flex-1 overflow-y-auto p-4">
<Routes>
<Show when={selectedEndpoint()}>
<Route path="/overview" component={Overview} />
<Route path="/proxies" component={Proxies} />
<Route path="/rules" component={Rules} />
<Route path="/conns" component={Connections} />
<Route path="/logs" component={Logs} />
<Route path="/config" component={Config} />
<Route path="*" component={Overview} />
<Route path="*" element={<Navigate href="/overview" />} />
</Show>

<Route path="/setup" component={Setup} />
Expand Down

0 comments on commit a114b35

Please sign in to comment.