fix(front): Fix not found error + add timeout

This commit is contained in:
Faton Ramadani
2022-08-23 22:42:32 +02:00
parent 92c67228ac
commit d8bb9dccff
2 changed files with 14 additions and 9 deletions
@@ -23,6 +23,7 @@
export async function runPreview(args: Record<string, any>) {
jobId = await runFlowPreview(args, newFlow)
intervalState = 'running'
}
@@ -58,7 +58,7 @@
return isReady
})
} else {
loadJobInProgress()
setTimeout(() => loadJobInProgress(), 500)
}
}
@@ -86,7 +86,9 @@
{#if `result` in job}
<FlowJobResult {job} />
{:else}
<pre>{job.logs}</pre>
<div class="text-xs p-4 bg-gray-50 overflow-auto max-h-80 border">
<pre class="w-full">{job.logs}</pre>
</div>
{/if}
{#if Array.isArray(forloopJobIds) && forloopJobIds?.length > 0 && Array.isArray(loopJobs)}
@@ -130,13 +132,15 @@
<span class="font-medium text-gray-900">{job?.raw_flow?.modules.length}</span>
</p>
<li class="w-full border p-6 space-y-2">
<svelte:self
jobId={module.job}
bind:jobResult={innerJobs[i]}
forloopJobIds={module.forloop_jobs}
/>
</li>
{#if module.type === 'InProgress'}
<li class="w-full border p-6 space-y-2">
<svelte:self
jobId={module.job}
bind:jobResult={innerJobs[i]}
forloopJobIds={module.forloop_jobs}
/>
</li>
{/if}
{/each}
</ul>
{/if}