Skip to content

Commit fd964e2

Browse files
author
Andrea Ceriani
committed
Merge branch '492-console-wide-account' of github.com:eth-cscs/firecrest-ui into 492-console-wide-account
2 parents ca2c464 + 4586700 commit fd964e2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/layouts/Sidebar.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ import { classNames } from '~/helpers/class-helper'
3333
import AppLogo from '~/logos/AppLogo'
3434
// mappers
3535
import { serviceIconMapper } from '~/mappers/icon-mapper'
36+
// contexts
37+
import { useSystem } from '~/contexts/SystemContext'
3638

3739
interface SidebarProps {
3840
sidebarOpen: boolean
@@ -54,15 +56,18 @@ const Sidebar: React.FC<any> = ({
5456
repoUrl = null,
5557
}: any) => {
5658
const location = useLocation()
57-
59+
const { systems } = useSystem()
5860
const userNavigation = [{ name: 'Dashboard', path: '/', icon: HomeIcon }]
5961

6062
const primaryNavigation: any = [
61-
{ name: LABEL_COMPUTE_TITLE, path: '/compute', icon: serviceIconMapper('compute') },
63+
{ name: LABEL_COMPUTE_TITLE, path: '/compute', icon: serviceIconMapper('compute'),
64+
children: systems.map(system => ({ name: system.name, path: '/compute/systems/'+system.name }))
65+
},
6266
{
6367
name: LABEL_FILESYSTEM_TITLE,
6468
path: '/filesystems',
6569
icon: serviceIconMapper('filesystem'),
70+
children: systems.map(system => ({ name: system.name, path: '/filesystems/systems/'+system.name }))
6671
},
6772
]
6873

0 commit comments

Comments
 (0)