feat(admin): add self-host setup and user management page (#7537)

This commit is contained in:
JimmFly
2024-08-13 14:11:03 +08:00
committed by GitHub
parent dc519348c5
commit ccf225c8f9
47 changed files with 2793 additions and 551 deletions
+9 -5
View File
@@ -23,8 +23,8 @@ const Redirect = function Redirect() {
const location = useLocation();
const navigate = useNavigate();
useEffect(() => {
if (!location.pathname.startsWith('/admin')) {
navigate('/admin', { replace: true });
if (!location.pathname.startsWith('/admin/accounts')) {
navigate('/admin/accounts', { replace: true });
}
}, [location, navigate]);
return null;
@@ -41,15 +41,19 @@ export const router = _createBrowserRouter(
children: [
{
path: '',
lazy: () => import('./modules/home'),
element: <Redirect />,
},
{
path: '/admin/accounts',
lazy: () => import('./modules/accounts'),
},
{
path: '/admin/auth',
lazy: () => import('./modules/auth'),
},
{
path: '/admin/users',
lazy: () => import('./modules/users'),
path: '/admin/setup',
lazy: () => import('./modules/setup'),
},
],
},