Adds persistance to showfootprint selection

This commit is contained in:
Christoph Kluge
2023-11-21 15:38:28 +01:00
parent dc860f8fd9
commit f342a65aba
3 changed files with 17 additions and 4 deletions

View File

@@ -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>