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

@@ -54,11 +54,6 @@
const nowEpoch = Date.now();
const paging = { itemsPerPage: 50, page: 1 };
const sorting = { field: "startTime", type: "col", order: "DESC" };
const filter = [
{ cluster: { eq: cluster } },
{ node: { contains: hostname } },
{ state: ["running"] },
];
const client = getContextClient();
const nodeMetricsQuery = gql`
query ($cluster: String!, $nodes: [String!], $from: Time!, $to: Time!) {
@@ -111,11 +106,18 @@
}
/* State Init */
// svelte-ignore state_referenced_locally
let from = $state(presetFrom ? presetFrom : new Date(nowEpoch - (4 * 3600 * 1000)));
// svelte-ignore state_referenced_locally
let to = $state(presetTo ? presetTo : new Date(nowEpoch));
let systemUnits = $state({});
/* Derived */
const filter = $derived([
{ cluster: { eq: cluster } },
{ node: { contains: hostname } },
{ state: ["running"] },
]);
const nodeMetricsData = $derived(queryStore({
client: client,
query: nodeMetricsQuery,