diff --git a/webui/src/common/layouts/Root.jsx b/webui/src/common/layouts/Root.jsx index 4f403bc..cfc367d 100644 --- a/webui/src/common/layouts/Root.jsx +++ b/webui/src/common/layouts/Root.jsx @@ -1,22 +1,40 @@ import React from 'react'; -import { Outlet } from 'react-router-dom'; +import {Outlet, useLocation} from 'react-router-dom'; import Sidebar from '@/common/components/Sidebar'; import ProfileMenu from '@/common/components/ProfileMenu'; +const getPageTitle = (pathname) => { + switch (pathname) { + case '/dashboard': + return 'Dashboard'; + case '/servers': + return 'Servers'; + case '/settings': + return 'Settings'; + case '/admin/users': + return 'User Management'; + default: + return 'Dashboard'; + } +}; + const Root = () => { - return ( -
- -
-
-

Dashboard

-
- -
- -
-
- ); + const location = useLocation(); + const pageTitle = getPageTitle(location.pathname); + + return ( +
+ +
+
+

{pageTitle}

+
+ +
+ +
+
+ ); }; export default Root; \ No newline at end of file