mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-03-04 15:17:29 +01:00
adapt frontend to backend config changes, clarify variable names
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
@component Navbar component; renders in app navigation links as received from upstream
|
||||
|
||||
Properties:
|
||||
- `clusters [String]`: List of cluster names
|
||||
- `subClusters map[String][]string`: Map of subclusters by cluster names
|
||||
- `clusterNames [String]`: List of cluster names
|
||||
- `subclusterMap map[String][]string`: Map of subclusters by cluster names
|
||||
- `links [Object]`: Pre-filtered link objects based on user auth
|
||||
- `direction String?`: The direcion of the drop-down menue [default: down]
|
||||
-->
|
||||
@@ -20,8 +20,8 @@
|
||||
|
||||
/* Svelte 5 Props */
|
||||
let {
|
||||
clusters,
|
||||
subClusters,
|
||||
clusterNames,
|
||||
subclusterMap,
|
||||
links,
|
||||
direction = "down"
|
||||
} = $props();
|
||||
@@ -36,25 +36,25 @@
|
||||
{item.title}
|
||||
</DropdownToggle>
|
||||
<DropdownMenu class="dropdown-menu-lg-end">
|
||||
{#each clusters as cluster}
|
||||
{#each clusterNames as cn}
|
||||
<Dropdown nav direction="right">
|
||||
<DropdownToggle nav caret class="dropdown-item py-1 px-2">
|
||||
{cluster.name}
|
||||
{cn}
|
||||
</DropdownToggle>
|
||||
<DropdownMenu>
|
||||
<DropdownItem class="py-1 px-2"
|
||||
href={item.href + cluster.name}
|
||||
href={item.href + cn}
|
||||
>
|
||||
Node Overview
|
||||
</DropdownItem>
|
||||
<DropdownItem class="py-1 px-2"
|
||||
href={item.href + 'list/' + cluster.name}
|
||||
href={`${item.href}list/${cn}`}
|
||||
>
|
||||
Node List
|
||||
</DropdownItem>
|
||||
{#each subClusters[cluster.name] as subCluster}
|
||||
{#each subclusterMap[cn] as scn}
|
||||
<DropdownItem class="py-1 px-2"
|
||||
href={item.href + 'list/' + cluster.name + '/' + subCluster}
|
||||
href={`${item.href}list/${cn}/${scn}`}
|
||||
>
|
||||
{subCluster} Node List
|
||||
</DropdownItem>
|
||||
@@ -71,19 +71,19 @@
|
||||
{item.title}
|
||||
</DropdownToggle>
|
||||
<DropdownMenu class="dropdown-menu-lg-end">
|
||||
{#each clusters as cluster}
|
||||
{#each clusterNames as cn}
|
||||
<Dropdown nav direction="right">
|
||||
<DropdownToggle nav caret class="dropdown-item py-1 px-2">
|
||||
{cluster.name}
|
||||
{cn}
|
||||
</DropdownToggle>
|
||||
<DropdownMenu>
|
||||
<DropdownItem class="py-1 px-2"
|
||||
href={item.href + cluster.name}
|
||||
href={item.href + cn}
|
||||
>
|
||||
Status Dashboard
|
||||
</DropdownItem>
|
||||
<DropdownItem class="py-1 px-2"
|
||||
href={item.href + 'detail/' + cluster.name}
|
||||
href={`${item.href}detail/${cn}`}
|
||||
>
|
||||
Status Details
|
||||
</DropdownItem>
|
||||
@@ -105,19 +105,19 @@
|
||||
All Clusters
|
||||
</DropdownItem>
|
||||
<DropdownItem divider />
|
||||
{#each clusters as cluster}
|
||||
{#each clusterNames as cn}
|
||||
<Dropdown nav direction="right">
|
||||
<DropdownToggle nav caret class="dropdown-item py-1 px-2">
|
||||
{cluster.name}
|
||||
{cn}
|
||||
</DropdownToggle>
|
||||
<DropdownMenu>
|
||||
<DropdownItem class="py-1 px-2"
|
||||
href={item.href + '?cluster=' + cluster.name}
|
||||
href={`${item.href}?cluster=${cn}`}
|
||||
>
|
||||
All Jobs
|
||||
</DropdownItem>
|
||||
<DropdownItem class="py-1 px-2"
|
||||
href={item.href + '?cluster=' + cluster.name + '&state=running'}
|
||||
href={`${item.href}?cluster=${cn}&state=running`}
|
||||
>
|
||||
Running Jobs
|
||||
</DropdownItem>
|
||||
@@ -138,12 +138,12 @@
|
||||
{item.title}
|
||||
</DropdownToggle>
|
||||
<DropdownMenu class="dropdown-menu-lg-end">
|
||||
{#each clusters as cluster}
|
||||
{#each clusterNames as cn}
|
||||
<DropdownItem
|
||||
href={item.href + cluster.name}
|
||||
active={window.location.pathname == item.href + cluster.name}
|
||||
href={item.href + cn}
|
||||
active={window.location.pathname == item.href + cn}
|
||||
>
|
||||
{cluster.name}
|
||||
{cn}
|
||||
</DropdownItem>
|
||||
{/each}
|
||||
</DropdownMenu>
|
||||
|
||||
Reference in New Issue
Block a user