svelte state_referenced_locally warning fixes

- change to derived where possible
- suppress warning elsewhere
- discussion here: sveltejs/svelte/issues/17289
This commit is contained in:
Christoph Kluge
2026-01-15 18:17:45 +01:00
parent cd3d133f0d
commit faacf3f343
41 changed files with 167 additions and 127 deletions

View File

@@ -37,13 +37,7 @@
/* Const Init */
const client = getContextClient();
const jobId = job.id;
const cluster = getContext("clusters");
const scopes = (job.numNodes == 1)
? (job.numAcc >= 1)
? ["core", "accelerator"]
: ["core"]
: ["node"];
const resampleConfig = getContext("resampling") || null;
const resampleDefault = resampleConfig ? Math.max(...resampleConfig.resolutions) : 0;
const query = gql`
@@ -84,6 +78,15 @@
let thresholdStates = $state({});
/* Derived */
const jobId = $derived(job?.id);
const scopes = $derived.by(() => {
if (job.numNodes == 1) {
if (job.numAcc >= 1) return ["core", "accelerator"];
else return ["core"];
} else {
return ["node"];
};
});
let isSelected = $derived(previousSelect);
let metricsQuery = $derived(queryStore({
client: client,