mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
refactor web file structure and seperate settings from status
This commit is contained in:
@@ -16,11 +16,9 @@ const LayoutAppBar: FC<LayoutAppBarProps> = ({ title, onToggleDrawer }) => {
|
||||
const pathnames = useLocation()
|
||||
.pathname.split('/')
|
||||
.filter((x) => x);
|
||||
const show_back = pathnames.length > 1;
|
||||
|
||||
const navigate = useNavigate();
|
||||
let show_back = false;
|
||||
if (pathnames.length > 1) {
|
||||
show_back = pathnames[0] !== 'system' || pathnames[1] === 'espsystemstatus';
|
||||
}
|
||||
|
||||
return (
|
||||
<AppBar
|
||||
|
||||
@@ -128,7 +128,11 @@ const LayoutMenu: FC = () => {
|
||||
</List>
|
||||
|
||||
<List style={{ marginTop: `auto` }}>
|
||||
<LayoutMenuItem icon={AssessmentIcon} label={LL.SYSTEM(0)} to="/system" />
|
||||
<LayoutMenuItem
|
||||
icon={AssessmentIcon}
|
||||
label={LL.STATUS_OF('')}
|
||||
to="/status"
|
||||
/>
|
||||
<LayoutMenuItem
|
||||
icon={SettingsIcon}
|
||||
label={LL.SETTINGS(0)}
|
||||
|
||||
@@ -59,18 +59,12 @@ const LayoutMenuItem: FC<ListMenuItemProps> = ({
|
||||
}
|
||||
>
|
||||
<ListItemButton component={Link} to={to}>
|
||||
<RenderIcon
|
||||
icon={icon}
|
||||
bgcolor={bgcolor}
|
||||
label={label}
|
||||
text={text}
|
||||
to=""
|
||||
/>
|
||||
<RenderIcon icon={icon} bgcolor={bgcolor} label={label} text={text} />
|
||||
</ListItemButton>
|
||||
</ListItem>
|
||||
) : (
|
||||
<ListItem>
|
||||
<RenderIcon icon={icon} bgcolor={bgcolor} label={label} text={text} to="" />
|
||||
<RenderIcon icon={icon} bgcolor={bgcolor} label={label} text={text} />
|
||||
</ListItem>
|
||||
)}
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user