From 7ef4d8b8b2f4c67306b5c0b234886136e309b084 Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Tue, 9 Sep 2025 13:33:05 +0200 Subject: [PATCH] Update page title in Root.jsx --- webui/src/common/layouts/Root.jsx | 46 +++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 14 deletions(-) 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