diff --git a/frontend/src/lib/components/RunChart.svelte b/frontend/src/lib/components/RunChart.svelte index 5142844585..2efc3a06a5 100644 --- a/frontend/src/lib/components/RunChart.svelte +++ b/frontend/src/lib/components/RunChart.svelte @@ -15,9 +15,12 @@ LogarithmicScale } from 'chart.js' import type { CompletedJob } from '$lib/gen' + import { createEventDispatcher } from 'svelte' export let jobs: CompletedJob[] | undefined = [] + const dispatch = createEventDispatcher() + $: success = jobs?.filter((x) => x.success) $: failed = jobs?.filter((x) => !x.success) ChartJS.register( @@ -54,13 +57,19 @@ const zoomOptions = { pan: { enabled: true, - modifierKey: 'ctrl' as 'ctrl' + modifierKey: 'ctrl' as 'ctrl', + onPan: ({ chart }) => { + console.log('XXX') + } }, zoom: { drag: { enabled: true }, - mode: 'x' as 'x' + mode: 'x' as 'x', + onZoom: ({ chart }) => { + dispatch('zoom', { min: new Date(chart.scales.x.min), max: new Date(chart.scales.x.max) }) + } } } diff --git a/frontend/src/lib/components/jobs/JobDetail.svelte b/frontend/src/lib/components/jobs/JobDetail.svelte index 759f862dc1..f2168639a2 100644 --- a/frontend/src/lib/components/jobs/JobDetail.svelte +++ b/frontend/src/lib/components/jobs/JobDetail.svelte @@ -1,4 +1,6 @@ @@ -162,8 +169,25 @@ tooltip="All past and schedule executions of scripts and flows, including previews. You only see your own runs or runs of groups you belong to unless you are an admin." /> + + + { + goto('/runs?' + $page.url.searchParams.toString()) + }} + size="xs"> + { + goto('/runs?' + $page.url.searchParams.toString()) + }} + size="xs"> + - + - + { + minTs = e.detail.min.toISOString() + maxTs = e.detail.max.toISOString() + jobs = await fetchJobs(maxTs, minTs) + }} + /> + + + min datetime + + + max datetime + + + { + minTs = undefined + maxTs = undefined + jobs = await fetchJobs(maxTs, minTs) + }} + size="xs"> {#if jobs}