diff --git a/internal/routerConfig/routes.go b/internal/routerConfig/routes.go index 78bab931..db499397 100644 --- a/internal/routerConfig/routes.go +++ b/internal/routerConfig/routes.go @@ -238,6 +238,9 @@ func buildFilterPresets(query url.Values) map[string]any { if query.Get("cluster") != "" { filterPresets["cluster"] = query.Get("cluster") } + if query.Get("subCluster") != "" { + filterPresets["subCluster"] = query.Get("subCluster") + } if query.Get("partition") != "" { filterPresets["partition"] = query.Get("partition") } diff --git a/web/frontend/src/generic/Filters.svelte b/web/frontend/src/generic/Filters.svelte index 3c0091ad..427eabdc 100644 --- a/web/frontend/src/generic/Filters.svelte +++ b/web/frontend/src/generic/Filters.svelte @@ -73,6 +73,7 @@ userMatch: "contains", // Filter Modals cluster: null, + subCluster: null, partition: null, states: allJobStates, shared: "", @@ -107,6 +108,7 @@ user: filterPresets?.user || "", userMatch: filterPresets?.userMatch || "contains", cluster: filterPresets?.cluster || null, + subCluster: filterPresets?.subCluster || null, partition: filterPresets?.partition || null, states: filterPresets?.states || filterPresets?.state @@ -158,6 +160,7 @@ if (filters.dbId.length != 0) items.push({ dbId: filters.dbId }); if (filters.cluster) items.push({ cluster: { eq: filters.cluster } }); + if (filters.subCluster) items.push({ subCluster: { eq: filters.subCluster } }); if (filters.partition) items.push({ partition: { eq: filters.partition } }); if (filters.states.length != allJobStates?.length) items.push({ state: filters.states }); @@ -267,6 +270,7 @@ opts.push(`userMatch=${filters.userMatch}`); // Filter Modals if (filters.cluster) opts.push(`cluster=${filters.cluster}`); + if (filters.subCluster) opts.push(`subCluster=${filters.subCluster}`); if (filters.partition) opts.push(`partition=${filters.partition}`); if (filters.states.length != allJobStates?.length) for (let state of filters.states) opts.push(`state=${state}`); @@ -346,7 +350,7 @@ {/if} Manage Filters (isClusterOpen = true)}> - Cluster/Partition + Cluster/SubCluster/Partition (isJobStatesOpen = true)}> Job States @@ -440,6 +444,9 @@ {#if filters.cluster} (isClusterOpen = true)}> {filters.cluster} + {#if filters.subCluster} + [{filters.subCluster}] + {/if} {#if filters.partition} ({filters.partition}) {/if} @@ -603,6 +610,7 @@ bind:isOpen={isClusterOpen} presetCluster={filters.cluster} presetPartition={filters.partition} + presetSubCluster={filters.subCluster} {disableClusterSelection} setFilter={(filter) => updateFilters(filter)} /> diff --git a/web/frontend/src/generic/filters/Cluster.svelte b/web/frontend/src/generic/filters/Cluster.svelte index bb02335e..4736ead1 100644 --- a/web/frontend/src/generic/filters/Cluster.svelte +++ b/web/frontend/src/generic/filters/Cluster.svelte @@ -1,10 +1,11 @@ @@ -26,6 +27,7 @@ isOpen = $bindable(false), presetCluster = "", presetPartition = "", + presetSubCluster = "", disableClusterSelection = false, setFilter } = $props(); @@ -36,10 +38,11 @@ const clusterInfos = $derived($initialized ? getContext("clusters") : null); let pendingCluster = $derived(presetCluster); let pendingPartition = $derived(presetPartition); + let pendingSubCluster = $derived(presetSubCluster); (isOpen = !isOpen)}> - Select Cluster & Slurm Partition + Select Cluster, SubCluster & Partition {#if $initialized}

Cluster

@@ -51,7 +54,7 @@ ((pendingCluster = null), (pendingPartition = null))} + onclick={() => ((pendingCluster = null), (pendingPartition = null), (pendingSubCluster = null))} > Any Cluster @@ -60,7 +63,7 @@ disabled={disableClusterSelection} active={pendingCluster == cluster.name} onclick={() => ( - (pendingCluster = cluster.name), (pendingPartition = null) + (pendingCluster = cluster.name), (pendingPartition = null), (pendingSubCluster = null) )} > {cluster.name} @@ -71,7 +74,27 @@ {/if} {#if $initialized && pendingCluster != null}
-

Partiton

+

SubCluster

+ + (pendingSubCluster = null)} + > + Any SubCluster + + {#each clusterInfos?.find((c) => c.name == pendingCluster)?.subClusters as subCluster} + (pendingSubCluster = subCluster.name)} + > + {subCluster.name} + + {/each} + + {/if} + {#if $initialized && pendingCluster != null} +
+

Partition

{ isOpen = false; - setFilter({ cluster: pendingCluster, partition: pendingPartition }); + setFilter({ cluster: pendingCluster, subCluster: pendingSubCluster, partition: pendingPartition }); }}>Close & Apply {#if !disableClusterSelection} @@ -105,7 +128,8 @@ isOpen = false; pendingCluster = null; pendingPartition = null; - setFilter({ cluster: pendingCluster, partition: pendingPartition}) + pendingSubCluster = null; + setFilter({ cluster: pendingCluster, subCluster: pendingSubCluster, partition: pendingPartition }) }}>Reset {/if}