mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-01-28 15:01:46 +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:
@@ -45,7 +45,6 @@
|
||||
const statsPattern = /(.*)-stat$/;
|
||||
const resampleConfig = getContext("resampling") || null;
|
||||
const resampleDefault = resampleConfig ? Math.max(...resampleConfig.resolutions) : 0;
|
||||
const unit = (metricUnit?.prefix ? metricUnit.prefix : "") + (metricUnit?.base ? metricUnit.base : "");
|
||||
const subQuery = gql`
|
||||
query ($dbid: ID!, $selectedMetrics: [String!]!, $selectedScopes: [MetricScope!]!, $selectedResolution: Int) {
|
||||
singleUpdate: jobMetrics(id: $dbid, metrics: $selectedMetrics, scopes: $selectedScopes, resolution: $selectedResolution) {
|
||||
@@ -79,14 +78,14 @@
|
||||
`;
|
||||
|
||||
/* State Init */
|
||||
let requestedScopes = $state(presetScopes);
|
||||
let selectedResolution = $state(resampleDefault);
|
||||
|
||||
let selectedHost = $state(null);
|
||||
let zoomState = $state(null);
|
||||
let thresholdState = $state(null);
|
||||
|
||||
/* Derived */
|
||||
let requestedScopes = $derived(presetScopes);
|
||||
const unit = $derived.by(() => { return (metricUnit?.prefix ? metricUnit.prefix : "") + (metricUnit?.base ? metricUnit.base : "")});
|
||||
const metricData = $derived(queryStore({
|
||||
client: client,
|
||||
query: subQuery,
|
||||
|
||||
@@ -25,9 +25,13 @@
|
||||
} = $props();
|
||||
|
||||
/* State Init */
|
||||
// svelte-ignore state_referenced_locally
|
||||
let sortedHosts = $state(hosts);
|
||||
// svelte-ignore state_referenced_locally
|
||||
let sorting = $state(setupSorting(selectedMetrics));
|
||||
// svelte-ignore state_referenced_locally
|
||||
let availableScopes = $state(setupAvailable(jobStats));
|
||||
// svelte-ignore state_referenced_locally
|
||||
let selectedScopes = $state(setupSelected(availableScopes));
|
||||
|
||||
/* Derived Init */
|
||||
|
||||
Reference in New Issue
Block a user