diff --git a/frontend/src/lib/components/flows/FlowProgressBar.svelte b/frontend/src/lib/components/flows/FlowProgressBar.svelte index 1b8a657075..ce27e263bb 100644 --- a/frontend/src/lib/components/flows/FlowProgressBar.svelte +++ b/frontend/src/lib/components/flows/FlowProgressBar.svelte @@ -9,6 +9,7 @@ let subIndex: number | undefined = undefined let subLength: number | undefined = undefined let length = 1 + let nextInProgress = false $: if (job) updateJobProgress(job) @@ -18,46 +19,49 @@ return } - let maxDone = 0 let subStepIndex: undefined | number = undefined let subStepLength: undefined | number = undefined let newError: number | undefined = undefined - modules.forEach((module, i) => { + let newNextInProgress = false + + let maxDone = job?.flow_status?.step ?? 0 + if (modules.length > maxDone) { + const nextModule = modules[maxDone] + if (nextModule.type === FlowStatusModule.type.IN_PROGRESS) { + newNextInProgress = true + } + } + + let module = modules[maxDone] + if (module) { if ( module.type === FlowStatusModule.type.FAILURE || (module.type === FlowStatusModule.type.SUCCESS && job['success'] === false) ) { - newError = i + newError = maxDone + maxDone = maxDone + 1 } + } - let isDone = isJobStepDone(module.type) - if (isDone) { - maxDone = i + 1 - return + // Loop is still iterating + if (module?.iterator) { + const stepIndex = module.iterator.index || 0 + const stepLength = module.iterator.itered?.length || 0 + if (module.iterator.index != undefined) { + subStepIndex = stepIndex + subStepLength = stepLength } + } else if (module?.branchall) { + subStepIndex = module.branchall.branch + subStepLength = module.branchall.len + } - // Loop is still iterating - if (module.iterator) { - const stepIndex = module.iterator.index || 0 - const stepLength = module.iterator.itered?.length || 0 - if (module.iterator.index != undefined) { - subStepIndex = stepIndex - subStepLength = stepLength - } - } else if (module.branchall) { - subStepIndex = module.branchall.branch - subStepLength = module.branchall.len - } - }) error = newError subLength = subStepLength ? Math.max(subStepLength, 1) : undefined subIndex = subStepIndex length = Math.max(modules.length, 1) index = maxDone - } - - function isJobStepDone(type: FlowStatusModule.type | undefined) { - return type === FlowStatusModule.type.SUCCESS || type === FlowStatusModule.type.FAILURE + nextInProgress = newNextInProgress } let resetP: any @@ -72,4 +76,13 @@ } - + diff --git a/frontend/src/lib/components/graph/FlowGraph.svelte b/frontend/src/lib/components/graph/FlowGraph.svelte index e85108becc..4194fbeb1f 100644 --- a/frontend/src/lib/components/graph/FlowGraph.svelte +++ b/frontend/src/lib/components/graph/FlowGraph.svelte @@ -161,7 +161,7 @@ nodes = layered.nodes let hfull = Math.max(layered.height, minHeight) fullWidth = layered.width - height = fullSize ? hfull : Math.min(hfull, maxHeight ?? window.innerHeight - 100) + height = fullSize ? hfull : Math.min(hfull, maxHeight ?? window.innerHeight * 1.5) let useDataflow = dataflow && showDataflow edges = useDataflow ? [] : createEdges(nodes) diff --git a/frontend/src/lib/components/preview/FlowPreviewStatus.svelte b/frontend/src/lib/components/preview/FlowPreviewStatus.svelte index 609e34d6c8..80ef460827 100644 --- a/frontend/src/lib/components/preview/FlowPreviewStatus.svelte +++ b/frontend/src/lib/components/preview/FlowPreviewStatus.svelte @@ -9,8 +9,8 @@ {#if job}
- Job Id + >
+ Flow's job Id: {job?.id} diff --git a/frontend/src/lib/components/progressBar/ProgressBar.svelte b/frontend/src/lib/components/progressBar/ProgressBar.svelte index e814f53395..00c80136c2 100644 --- a/frontend/src/lib/components/progressBar/ProgressBar.svelte +++ b/frontend/src/lib/components/progressBar/ProgressBar.svelte @@ -2,7 +2,7 @@ import { tweened } from 'svelte/motion' import { linear } from 'svelte/easing' - export function getTween(initialValue = 0, duration = 200) { + function getTween(initialValue = 0, duration = 200) { return tweened(initialValue, { duration, easing: linear @@ -13,6 +13,7 @@ export let index: number export let subIndex: number | undefined export let subLength: number | undefined + export let nextInProgress: boolean = false export let length: number let duration = 200 @@ -48,7 +49,7 @@ : 'text-blue-700 dark:text-blue-200'}" > - {error + {error != undefined ? 'Error occured' : finished ? 'Done' @@ -70,13 +71,15 @@
{#each new Array(length) as _, partIndex (partIndex)}
- {#if partIndex < index - 1} + {#if partIndex == index && nextInProgress}
- {:else if partIndex == index - 1 || (partIndex == index && subIndex !== undefined)} + {/if} + {#if partIndex < index - 1} +
+ {:else if partIndex == index - 1 || (partIndex == index && subIndex !== undefined) || error == partIndex}