2023-05-19 11:43:25 -04:00
|
|
|
import Article from '@mui/icons-material/Article';
|
|
|
|
import EditNotifications from '@mui/icons-material/EditNotifications';
|
|
|
|
import ExpandLess from '@mui/icons-material/ExpandLess';
|
|
|
|
import ExpandMore from '@mui/icons-material/ExpandMore';
|
|
|
|
import Extension from '@mui/icons-material/Extension';
|
|
|
|
import Lan from '@mui/icons-material/Lan';
|
|
|
|
import Schedule from '@mui/icons-material/Schedule';
|
|
|
|
import VpnKey from '@mui/icons-material/VpnKey';
|
2022-11-28 16:39:13 -05:00
|
|
|
import Collapse from '@mui/material/Collapse';
|
|
|
|
import List from '@mui/material/List';
|
|
|
|
import ListItem from '@mui/material/ListItem';
|
|
|
|
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
|
|
import ListItemText from '@mui/material/ListItemText';
|
|
|
|
import ListSubheader from '@mui/material/ListSubheader';
|
|
|
|
import React from 'react';
|
|
|
|
import { useLocation } from 'react-router-dom';
|
|
|
|
|
2023-09-27 02:07:40 -04:00
|
|
|
import ListItemLink from 'components/ListItemLink';
|
2022-11-28 16:39:13 -05:00
|
|
|
import globalize from 'scripts/globalize';
|
|
|
|
|
|
|
|
const PLUGIN_PATHS = [
|
|
|
|
'/installedplugins.html',
|
|
|
|
'/availableplugins.html',
|
|
|
|
'/repositories.html',
|
2023-05-20 00:50:52 -04:00
|
|
|
'/addplugin.html',
|
2022-11-28 16:39:13 -05:00
|
|
|
'/configurationpage'
|
|
|
|
];
|
|
|
|
|
|
|
|
const AdvancedDrawerSection = () => {
|
|
|
|
const location = useLocation();
|
|
|
|
|
|
|
|
const isPluginSectionOpen = PLUGIN_PATHS.includes(location.pathname);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<List
|
|
|
|
aria-labelledby='advanced-subheader'
|
|
|
|
subheader={
|
|
|
|
<ListSubheader component='div' id='advanced-subheader'>
|
|
|
|
{globalize.translate('TabAdvanced')}
|
|
|
|
</ListSubheader>
|
|
|
|
}
|
|
|
|
>
|
|
|
|
<ListItem disablePadding>
|
|
|
|
<ListItemLink to='/networking.html'>
|
|
|
|
<ListItemIcon>
|
|
|
|
<Lan />
|
|
|
|
</ListItemIcon>
|
|
|
|
<ListItemText primary={globalize.translate('TabNetworking')} />
|
|
|
|
</ListItemLink>
|
|
|
|
</ListItem>
|
|
|
|
<ListItem disablePadding>
|
|
|
|
<ListItemLink to='/apikeys.html'>
|
|
|
|
<ListItemIcon>
|
|
|
|
<VpnKey />
|
|
|
|
</ListItemIcon>
|
|
|
|
<ListItemText primary={globalize.translate('HeaderApiKeys')} />
|
|
|
|
</ListItemLink>
|
|
|
|
</ListItem>
|
|
|
|
<ListItem disablePadding>
|
|
|
|
<ListItemLink to='/log.html'>
|
|
|
|
<ListItemIcon>
|
|
|
|
<Article />
|
|
|
|
</ListItemIcon>
|
|
|
|
<ListItemText primary={globalize.translate('TabLogs')} />
|
|
|
|
</ListItemLink>
|
|
|
|
</ListItem>
|
|
|
|
<ListItem disablePadding>
|
|
|
|
<ListItemLink to='/notificationsettings.html'>
|
|
|
|
<ListItemIcon>
|
|
|
|
<EditNotifications />
|
|
|
|
</ListItemIcon>
|
2023-05-19 11:43:25 -04:00
|
|
|
<ListItemText primary={globalize.translate('Notifications')} />
|
2022-11-28 16:39:13 -05:00
|
|
|
</ListItemLink>
|
|
|
|
</ListItem>
|
|
|
|
<ListItem disablePadding>
|
|
|
|
<ListItemLink to='/installedplugins.html' selected={false}>
|
|
|
|
<ListItemIcon>
|
|
|
|
<Extension />
|
|
|
|
</ListItemIcon>
|
|
|
|
<ListItemText primary={globalize.translate('TabPlugins')} />
|
|
|
|
{isPluginSectionOpen ? <ExpandLess /> : <ExpandMore />}
|
|
|
|
</ListItemLink>
|
|
|
|
</ListItem>
|
|
|
|
<Collapse in={isPluginSectionOpen} timeout='auto' unmountOnExit>
|
|
|
|
<List component='div' disablePadding>
|
|
|
|
<ListItemLink to='/installedplugins.html' sx={{ pl: 4 }}>
|
|
|
|
<ListItemText inset primary={globalize.translate('TabMyPlugins')} />
|
|
|
|
</ListItemLink>
|
|
|
|
<ListItemLink to='/availableplugins.html' sx={{ pl: 4 }}>
|
|
|
|
<ListItemText inset primary={globalize.translate('TabCatalog')} />
|
|
|
|
</ListItemLink>
|
|
|
|
<ListItemLink to='/repositories.html' sx={{ pl: 4 }}>
|
|
|
|
<ListItemText inset primary={globalize.translate('TabRepositories')} />
|
|
|
|
</ListItemLink>
|
|
|
|
</List>
|
|
|
|
</Collapse>
|
|
|
|
<ListItem disablePadding>
|
|
|
|
<ListItemLink to='/scheduledtasks.html'>
|
|
|
|
<ListItemIcon>
|
|
|
|
<Schedule />
|
|
|
|
</ListItemIcon>
|
|
|
|
<ListItemText primary={globalize.translate('TabScheduledTasks')} />
|
|
|
|
</ListItemLink>
|
|
|
|
</ListItem>
|
|
|
|
</List>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default AdvancedDrawerSection;
|