mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-02-12 14:01:45 +01:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user