Handle single update data

This commit is contained in:
Christoph Kluge 2024-08-16 16:35:17 +02:00
parent b1fd07cd30
commit b70de5a4be

View File

@ -25,7 +25,7 @@
Spinner, Spinner,
Card, Card,
} from "@sveltestrap/sveltestrap"; } from "@sveltestrap/sveltestrap";
import { minScope } from "../generic/utils"; import { minScope } from "../generic/utils.js";
import Timeseries from "../generic/plots/MetricPlot.svelte"; import Timeseries from "../generic/plots/MetricPlot.svelte";
export let job; export let job;
@ -87,20 +87,13 @@
const selectedMetrics = [metricName] const selectedMetrics = [metricName]
function loadUpdate() { function loadUpdate() {
console.log('S> OLD DATA:', rawData)
// useQuery('repoData', () =>
// fetch('https://api.github.com/repos/SvelteStack/svelte-query').then(res =>
// res.json()
// )
metricData = queryStore({ metricData = queryStore({
client: client, client: client,
query: subQuery, query: subQuery,
variables: { dbid, selectedMetrics, selectedScopes, selectedResolution }, variables: { dbid, selectedMetrics, selectedScopes, selectedResolution },
}); });
console.log('S> OLD DATA:', rawData)
// rawData = {...$metricData?.data?.singleUpdate}
}; };
$: if (selectedScope == "load-all") { $: if (selectedScope == "load-all") {
@ -121,10 +114,11 @@
(series) => selectedHost == null || series.hostname == selectedHost, (series) => selectedHost == null || series.hostname == selectedHost,
); );
$: if ($metricData && !$metricData.fetching) console.log('S> NEW DATA:', rawData) $: if ($metricData && !$metricData.fetching) {
// $: console.log('Pattern', patternMatches) rawData = $metricData.data.singleUpdate.map((x) => x.metric)
console.log('S> NEW DATA:', rawData)
}
$: console.log('SelectedScope', selectedScope) $: console.log('SelectedScope', selectedScope)
$: console.log('ScopeIndex', selectedScopeIndex)
</script> </script>
<InputGroup> <InputGroup>
@ -154,7 +148,7 @@
scopes = ["node"] scopes = ["node"]
selectedScope = "node" selectedScope = "node"
selectedScopes = [...scopes] selectedScopes = [...scopes]
loadUpdate loadUpdate()
}}> }}>
{#each resolutions as res} {#each resolutions as res}
<option value={res}>Timestep: {res}</option> <option value={res}>Timestep: {res}</option>