diff --git a/frontend/src/lib/components/FlowStatusViewer.svelte b/frontend/src/lib/components/FlowStatusViewer.svelte index 8ad9221e24..379672cdbd 100644 --- a/frontend/src/lib/components/FlowStatusViewer.svelte +++ b/frontend/src/lib/components/FlowStatusViewer.svelte @@ -55,6 +55,8 @@ globalDurationStatuses={[]} globalModuleStates={[]} bind:selectedNode={selectedJobStep} + on:start + on:done {jobId} {workspaceId} {isOwner} diff --git a/frontend/src/lib/components/FlowStatusViewerInner.svelte b/frontend/src/lib/components/FlowStatusViewerInner.svelte index ee090373d5..e58d7b995e 100644 --- a/frontend/src/lib/components/FlowStatusViewerInner.svelte +++ b/frontend/src/lib/components/FlowStatusViewerInner.svelte @@ -196,6 +196,7 @@ let errorCount = 0 let notAnonynmous = false async function loadJobInProgress() { + dispatch('start') if (jobId != '00000000-0000-0000-0000-000000000000') { try { const newJob = await JobService.getJob({ @@ -223,6 +224,8 @@ } if (job?.type !== 'CompletedJob' && errorCount < 4 && !destroyed) { timeout = setTimeout(() => loadJobInProgress(), reducedPolling ? 5000 : 1000) + } else { + dispatch('done', job) } } diff --git a/frontend/src/lib/components/apps/components/display/AppFlowStatusComponent.svelte b/frontend/src/lib/components/apps/components/display/AppFlowStatusComponent.svelte index 88ba46dbc5..44067afed6 100644 --- a/frontend/src/lib/components/apps/components/display/AppFlowStatusComponent.svelte +++ b/frontend/src/lib/components/apps/components/display/AppFlowStatusComponent.svelte @@ -1,80 +1,16 @@ -{#each Object.keys(css ?? {}) as key (key)} - -{/each} - - { - jobId = e.detail - }} - {outputs} - {render} - {componentInput} - {id} -> -
-
- Flow Status -
-
- {#if jobId} - - {:else} - No flow - {/if} -
-
-
+ + + This component is deprecated and has been removed. Please use the Flow status by Job Id + component instead. + + diff --git a/frontend/src/lib/components/apps/components/display/AppJobIdFlowStatus.svelte b/frontend/src/lib/components/apps/components/display/AppJobIdFlowStatus.svelte index 7faa8ddc8e..758fecc2c4 100644 --- a/frontend/src/lib/components/apps/components/display/AppJobIdFlowStatus.svelte +++ b/frontend/src/lib/components/apps/components/display/AppJobIdFlowStatus.svelte @@ -2,9 +2,7 @@ import { getContext } from 'svelte' import { twMerge } from 'tailwind-merge' import { initConfig, initOutput } from '../../editor/appUtils' - import type { AppInput } from '../../inputType' import type { AppViewerContext, ComponentCustomCSS, RichConfigurations } from '../../types' - import RunnableWrapper from '../helpers/RunnableWrapper.svelte' import { initCss } from '../../utils' import FlowStatusViewer from '$lib/components/FlowStatusViewer.svelte' import { components } from '../../editor/component' @@ -12,22 +10,22 @@ import ResolveStyle from '../helpers/ResolveStyle.svelte' export let id: string - export let componentInput: AppInput | undefined export let initializing: boolean | undefined = false export let customCss: ComponentCustomCSS<'jobidflowstatuscomponent'> | undefined = undefined - export let render: boolean export let configuration: RichConfigurations + export let render: boolean const { app, worldStore, workspace } = getContext('AppViewerContext') - let resolvedConfig = initConfig( + const resolvedConfig = initConfig( components['jobidlogcomponent'].initialData.configuration, configuration ) const outputs = initOutput($worldStore, id, { result: undefined, - loading: false + loading: false, + jobId: undefined as string | undefined }) initializing = false @@ -56,7 +54,7 @@ /> {/each} - +{#if render}
{#if jobId} - + { + outputs?.jobId.set(jobId) + outputs?.loading.set(true) + }} + on:done={(e) => { + outputs?.loading.set(false) + outputs?.result.set(e?.detail?.result) + }} + /> {:else} No flow {/if}
-
+{/if} diff --git a/frontend/src/lib/components/apps/components/display/AppJobIdLogComponent.svelte b/frontend/src/lib/components/apps/components/display/AppJobIdLogComponent.svelte index cb82ffbf9e..9c3e29a042 100644 --- a/frontend/src/lib/components/apps/components/display/AppJobIdLogComponent.svelte +++ b/frontend/src/lib/components/apps/components/display/AppJobIdLogComponent.svelte @@ -2,9 +2,7 @@ import { getContext } from 'svelte' import { twMerge } from 'tailwind-merge' import { initConfig, initOutput } from '../../editor/appUtils' - import type { AppInput } from '../../inputType' import type { AppViewerContext, ComponentCustomCSS, RichConfigurations } from '../../types' - import RunnableWrapper from '../helpers/RunnableWrapper.svelte' import { initCss } from '../../utils' import LogViewer from '$lib/components/LogViewer.svelte' import TestJobLoader from '$lib/components/TestJobLoader.svelte' @@ -14,11 +12,10 @@ import ResolveStyle from '../helpers/ResolveStyle.svelte' export let id: string - export let componentInput: AppInput | undefined export let initializing: boolean | undefined = false export let customCss: ComponentCustomCSS<'jobidlogcomponent'> | undefined = undefined - export let render: boolean export let configuration: RichConfigurations + export let render: boolean const { app, worldStore, workspace } = getContext('AppViewerContext') @@ -42,6 +39,7 @@ let testJob: Job | undefined = undefined $: if (resolvedConfig.jobId) { + outputs.loading.set(true) testJobLoader?.watchJob(resolvedConfig?.['jobId']) } @@ -70,9 +68,14 @@ bind:this={testJobLoader} bind:isLoading={testIsLoading} bind:job={testJob} + on:done={(e) => { + outputs.loading.set(false) + outputs.jobId.set(e.detail.id) + outputs.result.set(e.detail.result) + }} /> - +{#if render}
-
+{/if} diff --git a/frontend/src/lib/components/apps/components/display/AppLogsComponent.svelte b/frontend/src/lib/components/apps/components/display/AppLogsComponent.svelte index 3ec2f5704d..1b444f788d 100644 --- a/frontend/src/lib/components/apps/components/display/AppLogsComponent.svelte +++ b/frontend/src/lib/components/apps/components/display/AppLogsComponent.svelte @@ -1,86 +1,16 @@ - - -{#each Object.keys(css ?? {}) as key (key)} - -{/each} - - { - testJobLoader?.watchJob(e.detail) - }} - {outputs} - {render} - {componentInput} - {id} -> -
-
- Logs -
-
- -
-
-
+ + + This component is deprecated and has been removed. Please use the Log by Job Id component + instead. + + diff --git a/frontend/src/lib/components/apps/editor/component/Component.svelte b/frontend/src/lib/components/apps/editor/component/Component.svelte index dd6c4d45a8..75fa758f4c 100644 --- a/frontend/src/lib/components/apps/editor/component/Component.svelte +++ b/frontend/src/lib/components/apps/editor/component/Component.svelte @@ -191,37 +191,23 @@ {render} /> {:else if component.type === 'logcomponent'} - + {:else if component.type === 'jobidlogcomponent'} {:else if component.type === 'flowstatuscomponent'} - + {:else if component.type === 'jobidflowstatuscomponent'} {:else if component.type === 'barchartcomponent'}