mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-01-20 19:41:44 +01:00
add subcluster reactivity to jobList
This commit is contained in:
@@ -54,9 +54,11 @@
|
||||
/* Derived */
|
||||
const presetProject = $derived(filterPresets?.project ? filterPresets.project : "");
|
||||
let selectedCluster = $derived(filterPresets?.cluster ? filterPresets.cluster : null);
|
||||
let selectedSubCluster = $derived(filterPresets?.partition ? filterPresets.partition : null);
|
||||
let metrics = $derived(filterPresets.cluster
|
||||
? ccconfig[`metricConfig_jobListMetrics:${filterPresets.cluster}`] ||
|
||||
ccconfig.metricConfig_jobListMetrics
|
||||
? filterPresets.partition
|
||||
? ccconfig[`metricConfig_jobListMetrics:${filterPresets.cluster}:${filterPresets.partition}`]
|
||||
: ccconfig[`metricConfig_jobListMetrics:${filterPresets.cluster}`] || ccconfig.metricConfig_jobListMetrics
|
||||
: ccconfig.metricConfig_jobListMetrics
|
||||
);
|
||||
let showFootprint = $derived(filterPresets.cluster
|
||||
@@ -86,6 +88,11 @@
|
||||
metrics = selectedCluster ? ccconfig[`metricConfig_jobListMetrics:${selectedCluster}`] : ccconfig.metricConfig_jobListMetrics
|
||||
});
|
||||
|
||||
$effect(() => {
|
||||
// Load Metric-Selection for last selected cluster
|
||||
metrics = selectedSubCluster ? ccconfig[`metricConfig_jobListMetrics:${selectedCluster}:${selectedSubCluster}`] : ccconfig[`metricConfig_jobListMetrics:${selectedCluster}`]
|
||||
});
|
||||
|
||||
/* On Mount */
|
||||
// The filterPresets are handled by the Filters component,
|
||||
// so we need to wait for it to be ready before we can start a query.
|
||||
@@ -134,6 +141,9 @@
|
||||
selectedCluster = detail.filters[0]?.cluster
|
||||
? detail.filters[0].cluster.eq
|
||||
: null;
|
||||
selectedSubCluster = detail.filters[1]?.partition
|
||||
? detail.filters[1].partition.eq
|
||||
: null;
|
||||
filterBuffer = [...detail.filters]
|
||||
if (showCompare) {
|
||||
jobCompare.queryJobs(detail.filters);
|
||||
@@ -220,6 +230,7 @@
|
||||
bind:showFootprint
|
||||
presetMetrics={metrics}
|
||||
cluster={selectedCluster}
|
||||
subCluster={selectedSubCluster}
|
||||
configName="metricConfig_jobListMetrics"
|
||||
footprintSelect
|
||||
applyMetrics={(newMetrics) =>
|
||||
|
||||
Reference in New Issue
Block a user