mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-25 12:59:06 +01:00
Adds persistance to showfootprint selection
This commit is contained in:
parent
dc860f8fd9
commit
f342a65aba
@ -19,10 +19,13 @@
|
||||
|
||||
let filterComponent; // see why here: https://stackoverflow.com/questions/58287729/how-can-i-export-a-function-from-a-svelte-component-that-changes-a-value-in-the
|
||||
let jobList, matchedJobs = null
|
||||
let sorting = { field: 'startTime', order: 'DESC' }, isSortingOpen = false, isMetricsSelectionOpen = false, showFootprint
|
||||
let sorting = { field: 'startTime', order: 'DESC' }, isSortingOpen = false, isMetricsSelectionOpen = false
|
||||
let metrics = filterPresets.cluster
|
||||
? ccconfig[`plot_list_selectedMetrics:${filterPresets.cluster}`] || ccconfig.plot_list_selectedMetrics
|
||||
: ccconfig.plot_list_selectedMetrics
|
||||
let showFootprint = filterPresets.cluster
|
||||
? !!ccconfig[`plot_list_showFootprint:${filterPresets.cluster}`]
|
||||
: !!ccconfig.plot_list_showFootprint
|
||||
let selectedCluster = filterPresets?.cluster ? filterPresets.cluster : null
|
||||
|
||||
// The filterPresets are handled by the Filters component,
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
let newMetricsOrder = []
|
||||
let unorderedMetrics = [...metrics]
|
||||
let pendingShowFootprint = showFootprint || false
|
||||
let pendingShowFootprint = !!showFootprint
|
||||
|
||||
onInit(() => {
|
||||
if (allMetrics == null) allMetrics = new Set()
|
||||
@ -92,7 +92,7 @@
|
||||
metrics = newMetricsOrder.filter(m => unorderedMetrics.includes(m))
|
||||
isOpen = false
|
||||
|
||||
showFootprint = pendingShowFootprint ? true : false
|
||||
showFootprint = !!pendingShowFootprint
|
||||
|
||||
updateConfigurationMutation({
|
||||
name: cluster == null ? configName : `${configName}:${cluster}`,
|
||||
@ -103,6 +103,16 @@
|
||||
// console.log('Error on subscription: ' + res.error)
|
||||
}
|
||||
})
|
||||
|
||||
updateConfigurationMutation({
|
||||
name: cluster == null ? 'plot_list_showFootprint' : `plot_list_showFootprint:${cluster}`,
|
||||
value: JSON.stringify(showFootprint)
|
||||
}).subscribe(res => {
|
||||
if (res.fetching === false && res.error) {
|
||||
console.log('Error on footprint subscription: ' + res.error)
|
||||
throw res.error
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
export let sorting = { field: "startTime", order: "DESC" };
|
||||
export let matchedJobs = 0;
|
||||
export let metrics = ccconfig.plot_list_selectedMetrics;
|
||||
export let showFootprint = false;
|
||||
export let showFootprint;
|
||||
|
||||
let itemsPerPage = ccconfig.plot_list_jobsPerPage;
|
||||
let page = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user