mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-27 05:49:04 +01:00
Handle single update data
This commit is contained in:
parent
b1fd07cd30
commit
b70de5a4be
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user