diff --git a/web/frontend/src/Header.svelte b/web/frontend/src/Header.svelte index de5159a..9b12403 100644 --- a/web/frontend/src/Header.svelte +++ b/web/frontend/src/Header.svelte @@ -40,13 +40,17 @@ usersTitle.set(3, "Managed Users"); usersTitle.set(4, "Users"); usersTitle.set(5, "Users"); + const projectsTitle = new Map(); + projectsTitle.set(3, "Managed Projects"); + projectsTitle.set(4, "Projects"); + projectsTitle.set(5, "Projects"); const views = [ { title: "My Jobs", requiredRole: roles.user, href: `/monitoring/user/${username}`, - icon: "bar-chart-line-fill", + icon: "bar-chart-line", perCluster: false, listOptions: false, menu: "none", @@ -58,25 +62,7 @@ icon: "card-list", perCluster: false, listOptions: false, - menu: "none", - }, - { - title: usersTitle.get(authlevel), - requiredRole: roles.manager, - href: "/monitoring/users/", - icon: "people-fill", - perCluster: true, - listOptions: true, - menu: "Groups", - }, - { - title: "Projects", - requiredRole: roles.support, - href: "/monitoring/projects/", - icon: "folder", - perCluster: true, - listOptions: true, - menu: "Groups", + menu: "Jobs", }, { title: "Tags", @@ -85,8 +71,44 @@ icon: "tags", perCluster: false, listOptions: false, + menu: "Jobs", + }, + { + title: usersTitle.get(authlevel), + requiredRole: roles.manager, + href: "/monitoring/users/", + icon: "people", + perCluster: true, + listOptions: true, menu: "Groups", }, + { + title: projectsTitle.get(authlevel), + requiredRole: roles.manager, + href: "/monitoring/projects/", + icon: "journals", + perCluster: true, + listOptions: true, + menu: "Groups", + }, + { + title: "Nodes", + requiredRole: roles.admin, + href: "/monitoring/systems/", + icon: "hdd-rack", + perCluster: true, + listOptions: false, + menu: "Info", + }, + { + title: "Status", + requiredRole: roles.admin, + href: "/monitoring/status/", + icon: "clipboard-data", + perCluster: true, + listOptions: false, + menu: "Info", + }, { title: "Analysis", requiredRole: roles.support, @@ -94,25 +116,7 @@ icon: "graph-up", perCluster: true, listOptions: false, - menu: "Stats", - }, - { - title: "Nodes", - requiredRole: roles.admin, - href: "/monitoring/systems/", - icon: "cpu", - perCluster: true, - listOptions: false, - menu: "Groups", - }, - { - title: "Status", - requiredRole: roles.admin, - href: "/monitoring/status/", - icon: "cpu", - perCluster: true, - listOptions: false, - menu: "Stats", + menu: "Info", }, ]; @@ -140,24 +144,27 @@ item.requiredRole <= authlevel && item.menu != "Stats", + (item) => item.requiredRole <= authlevel && item.menu != "Info", )} /> - - - - Stats - - - - item.requiredRole <= authlevel && item.menu == "Stats", - )} - /> - - + {#if authlevel >= 4} + + + + Info + + + + item.requiredRole <= authlevel && item.menu == "Info", + )} + /> + + + {/if} {:else} item.requiredRole <= authlevel && item.menu == "none", )} /> - {#each Array("Groups", "Stats") as menu} + {#if authlevel >= 2} - {menu} + Jobs item.requiredRole <= authlevel && item.menu == menu, + (item) => item.requiredRole <= authlevel && item.menu == 'Jobs', )} /> - {/each} + {/if} + {#if authlevel >= 3} + + + Groups + + + item.requiredRole <= authlevel && item.menu == 'Groups', + )} + /> + + + {/if} + {#if authlevel >= 4} + + + Info + + + item.requiredRole <= authlevel && item.menu == 'Info', + )} + /> + + + {/if} {/if} diff --git a/web/frontend/src/header/NavbarLinks.svelte b/web/frontend/src/header/NavbarLinks.svelte index ef9e49c..c99f35d 100644 --- a/web/frontend/src/header/NavbarLinks.svelte +++ b/web/frontend/src/header/NavbarLinks.svelte @@ -4,6 +4,7 @@ Properties: - `clusters [String]`: List of cluster names - `links [Object]`: Pre-filtered link objects based on user auth + - `direction String?`: The direcion of the drop-down menue [default: down] --> {#each links as item} {#if item.listOptions} - + {item.title} @@ -60,7 +62,7 @@ > {item.title} {:else} - + {item.title}