mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-11 16:09:39 +00:00
fix: fix reactivity issue on loading live flow on runs page
This commit is contained in:
@@ -1099,6 +1099,14 @@ export function isFlowPreview(job_kind: Job['job_kind'] | undefined) {
|
||||
return !!job_kind && (job_kind === 'flowpreview' || job_kind === 'flownode')
|
||||
}
|
||||
|
||||
export function isNotFlow(job_kind: Job['job_kind'] | undefined) {
|
||||
return (
|
||||
job_kind !== 'flow' &&
|
||||
job_kind !== 'singlescriptflow' &&
|
||||
!isFlowPreview(job_kind)
|
||||
)
|
||||
}
|
||||
|
||||
export function isScriptPreview(job_kind: Job['job_kind'] | undefined) {
|
||||
return (
|
||||
!!job_kind && (job_kind === 'preview' || job_kind === 'flowscript' || job_kind === 'appscript')
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
emptyString,
|
||||
encodeState,
|
||||
isFlowPreview,
|
||||
isNotFlow,
|
||||
isScriptPreview,
|
||||
truncateHash,
|
||||
truncateRev
|
||||
@@ -119,7 +120,7 @@
|
||||
|
||||
let showExplicitProgressTip: boolean =
|
||||
(localStorage.getItem('hideExplicitProgressTip') ?? 'false') == 'false'
|
||||
$: job?.logs == undefined && job && viewTab == 'logs' && getLogs?.()
|
||||
$: job?.logs == undefined && job && viewTab == 'logs' && isNotFlow(job?.job_kind) && getLogs?.()
|
||||
|
||||
let lastJobId: string | undefined = undefined
|
||||
let concurrencyKey: string | undefined = undefined
|
||||
@@ -222,15 +223,19 @@
|
||||
})
|
||||
}
|
||||
|
||||
if (job === undefined || job.job_kind !== 'script' || job.script_hash === undefined) {
|
||||
return
|
||||
}
|
||||
const script = await ScriptService.getScriptByHash({
|
||||
workspace: $workspaceStore!,
|
||||
hash: job.script_hash
|
||||
})
|
||||
if (script.restart_unless_cancelled ?? false) {
|
||||
persistentScriptDefinition = script
|
||||
if (
|
||||
job &&
|
||||
job.job_kind === 'script' &&
|
||||
job.script_hash &&
|
||||
persistentScriptDefinition === undefined
|
||||
) {
|
||||
const script = await ScriptService.getScriptByHash({
|
||||
workspace: $workspaceStore!,
|
||||
hash: job.script_hash
|
||||
})
|
||||
if (script.restart_unless_cancelled ?? false) {
|
||||
persistentScriptDefinition = script
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,6 +246,7 @@
|
||||
|
||||
function onRunsPageChange() {
|
||||
job = undefined
|
||||
persistentScriptDefinition = undefined
|
||||
}
|
||||
$: $workspaceStore && $page.params.run && onRunsPageChange()
|
||||
$: $workspaceStore && $page.params.run && testJobLoader && onRunsPageChangeWithLoader()
|
||||
@@ -846,7 +852,7 @@
|
||||
<h2 class="mt-10">Scheduled to be executed later: {displayDate(job?.['scheduled_for'])}</h2>
|
||||
</div>
|
||||
{/if}
|
||||
{#if job?.job_kind !== 'flow' && job?.job_kind !== 'singlescriptflow' && !isFlowPreview(job?.job_kind)}
|
||||
{#if isNotFlow(job?.job_kind)}
|
||||
{#if ['python3', 'bun', 'deno'].includes(job?.language ?? '') && (job?.job_kind == 'script' || isScriptPreview(job?.job_kind))}
|
||||
<ExecutionDuration bind:job bind:longRunning={currentJobIsLongRunning} />
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user