add lastThreshold to jobListRow

This commit is contained in:
Christoph Kluge 2024-11-29 14:15:15 +01:00
parent c853d74ba0
commit 93377f53fc

View File

@ -37,6 +37,7 @@
: ["node"]; : ["node"];
let selectedResolution = resampleDefault; let selectedResolution = resampleDefault;
let zoomStates = {}; let zoomStates = {};
let thresholdStates = {};
const cluster = getContext("clusters").find((c) => c.name == job.cluster); const cluster = getContext("clusters").find((c) => c.name == job.cluster);
const client = getContextClient(); const client = getContextClient();
@ -80,6 +81,13 @@
zoomStates[metric] = {...detail.lastZoomState} zoomStates[metric] = {...detail.lastZoomState}
} }
if ( // States have to differ, causes deathloop if just set
detail?.lastThreshold &&
thresholdStates[metric] !== detail.lastThreshold
) { // Handle to correctly reset on summed metric scope change
thresholdStates[metric] = detail.lastThreshold;
}
if (detail?.newRes) { // Triggers GQL if (detail?.newRes) { // Triggers GQL
selectedResolution = detail.newRes selectedResolution = detail.newRes
} }
@ -191,6 +199,7 @@
numhwthreads={job.numHWThreads} numhwthreads={job.numHWThreads}
numaccs={job.numAcc} numaccs={job.numAcc}
zoomState={zoomStates[metric.data.name] || null} zoomState={zoomStates[metric.data.name] || null}
thresholdState={thresholdStates[metric.data.name] || null}
/> />
{:else if metric.disabled == true && metric.data} {:else if metric.disabled == true && metric.data}
<Card body color="info" <Card body color="info"