mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-03-04 14:05:56 +01:00
fix: user and status view histogram selection
- correctly loads selection for selected cluster - applies availablility for selected cluster
This commit is contained in:
parent
6268dffff8
commit
1031b3eb79
@ -76,8 +76,8 @@
|
|||||||
|
|
||||||
let isHistogramSelectionOpen = false;
|
let isHistogramSelectionOpen = false;
|
||||||
$: metricsInHistograms = cluster
|
$: metricsInHistograms = cluster
|
||||||
? ccconfig[`user_view_histogramMetrics:${cluster}`] || []
|
? ccconfig[`user_view_histogramMetrics:${cluster}`] || ( ccconfig['user_view_histogramMetrics'] || [] )
|
||||||
: ccconfig.user_view_histogramMetrics || [];
|
: ccconfig['user_view_histogramMetrics'] || [];
|
||||||
|
|
||||||
const client = getContextClient();
|
const client = getContextClient();
|
||||||
// Note: nodeMetrics are requested on configured $timestep resolution
|
// Note: nodeMetrics are requested on configured $timestep resolution
|
||||||
|
@ -69,8 +69,8 @@
|
|||||||
let metricBinOptions = [10, 20, 50, 100];
|
let metricBinOptions = [10, 20, 50, 100];
|
||||||
|
|
||||||
$: metricsInHistograms = selectedCluster
|
$: metricsInHistograms = selectedCluster
|
||||||
? ccconfig[`user_view_histogramMetrics:${selectedCluster}`] || []
|
? ccconfig[`user_view_histogramMetrics:${selectedCluster}`] || ( ccconfig['user_view_histogramMetrics'] || [] )
|
||||||
: ccconfig.user_view_histogramMetrics || [];
|
: ccconfig['user_view_histogramMetrics'] || [];
|
||||||
|
|
||||||
const client = getContextClient();
|
const client = getContextClient();
|
||||||
$: stats = queryStore({
|
$: stats = queryStore({
|
||||||
|
@ -27,15 +27,23 @@
|
|||||||
const client = getContextClient();
|
const client = getContextClient();
|
||||||
const initialized = getContext("initialized");
|
const initialized = getContext("initialized");
|
||||||
|
|
||||||
let availableMetrics = []
|
|
||||||
|
|
||||||
function loadHistoMetrics(isInitialized) {
|
function loadHistoMetrics(isInitialized, thisCluster) {
|
||||||
if (!isInitialized) return;
|
if (!isInitialized) return [];
|
||||||
const rawAvailableMetrics = getContext("globalMetrics").filter((gm) => gm?.footprint).map((fgm) => { return fgm.name })
|
|
||||||
availableMetrics = [...rawAvailableMetrics]
|
if (!thisCluster) {
|
||||||
|
return getContext("globalMetrics")
|
||||||
|
.filter((gm) => gm?.footprint)
|
||||||
|
.map((fgm) => { return fgm.name })
|
||||||
|
} else {
|
||||||
|
return getContext("globalMetrics")
|
||||||
|
.filter((gm) => gm?.availability.find((av) => av.cluster == thisCluster))
|
||||||
|
.filter((agm) => agm?.footprint)
|
||||||
|
.map((afgm) => { return afgm.name })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let pendingMetrics = [...metricsInHistograms]; // Copy
|
$: pendingMetrics = [...metricsInHistograms]; // Copy on change from above
|
||||||
|
|
||||||
const updateConfigurationMutation = ({ name, value }) => {
|
const updateConfigurationMutation = ({ name, value }) => {
|
||||||
return mutationStore({
|
return mutationStore({
|
||||||
@ -71,7 +79,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$: loadHistoMetrics($initialized);
|
$: availableMetrics = loadHistoMetrics($initialized, cluster);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user