diff --git a/interface/src/components/layout/LayoutAppBar.tsx b/interface/src/components/layout/LayoutAppBar.tsx index 0b076f6ca..3d1a5c433 100644 --- a/interface/src/components/layout/LayoutAppBar.tsx +++ b/interface/src/components/layout/LayoutAppBar.tsx @@ -1,5 +1,7 @@ import type { FC } from 'react'; +import { useLocation, useNavigate } from 'react-router-dom'; +import ArrowBackIcon from '@mui/icons-material/ArrowBack'; import MenuIcon from '@mui/icons-material/Menu'; import { AppBar, IconButton, Toolbar, Typography } from '@mui/material'; @@ -10,30 +12,52 @@ interface LayoutAppBarProps { onToggleDrawer: () => void; } -const LayoutAppBar: FC = ({ title, onToggleDrawer }) => ( - - - - - - - {title} - - - -); +const LayoutAppBar: FC = ({ title, onToggleDrawer }) => { + const pathnames = useLocation() + .pathname.split('/') + .filter((x) => x); + const navigate = useNavigate(); + let show_back = false; + if (pathnames.length > 1) { + show_back = pathnames[0] !== 'system' || pathnames[1] === 'espsystemstatus'; + } + + return ( + + + + + + + {show_back && ( + navigate(pathnames[0])} + > + + + )} + + + {title} + + + + ); +}; export default LayoutAppBar; diff --git a/interface/src/framework/system/SystemLog.tsx b/interface/src/framework/system/SystemLog.tsx index 384a4e10b..8ee65396a 100644 --- a/interface/src/framework/system/SystemLog.tsx +++ b/interface/src/framework/system/SystemLog.tsx @@ -75,7 +75,7 @@ const levelLabel = (level: LogLevel) => { const SystemLog: FC = () => { const { LL } = useI18nContext(); - useLayoutTitle(LL.LOG_OF('')); + useLayoutTitle(LL.SYSTEM(0)); const { loadData, diff --git a/interface/src/framework/system/SystemStatus.tsx b/interface/src/framework/system/SystemStatus.tsx index 3a60cc832..7c115c495 100644 --- a/interface/src/framework/system/SystemStatus.tsx +++ b/interface/src/framework/system/SystemStatus.tsx @@ -47,7 +47,7 @@ import RestartMonitor from './RestartMonitor'; const SystemStatus: FC = () => { const { LL } = useI18nContext(); - useLayoutTitle(LL.STATUS_OF('')); + useLayoutTitle(LL.SYSTEM(0)); const { me } = useContext(AuthenticatedContext); diff --git a/interface/src/project/SystemActivity.tsx b/interface/src/project/SystemActivity.tsx index 5b14a92a3..ade2e653c 100644 --- a/interface/src/project/SystemActivity.tsx +++ b/interface/src/project/SystemActivity.tsx @@ -27,7 +27,7 @@ const SystemActivity: FC = () => { const { LL } = useI18nContext(); - useLayoutTitle(LL.ACTIVITY()); + useLayoutTitle(LL.SYSTEM(0)); const stats_theme = tableTheme({ Table: `