improve app timelines

This commit is contained in:
Ruben Fiszel
2023-10-31 23:43:40 +01:00
parent b3d2213cce
commit f2758fac40
3 changed files with 6 additions and 2 deletions

View File

@@ -171,6 +171,8 @@
dispatch('done', job)
}
currentId = undefined
} else {
dispatch('cancel', id)
}
}
notfound = false
@@ -185,6 +187,7 @@
}
return isCompleted
} else {
dispatch('cancel', id)
return true
}
}

View File

@@ -422,7 +422,6 @@
async function setResult(res: any, jobId: string | undefined) {
dispatch('done')
const errors = getResultErrors(res)
if (errors) {
@@ -552,12 +551,12 @@
if (job && job.started_at && !job.duration_ms) {
$jobsById[jobId] = {
...job,
started_compute_at: job.started_compute_at ?? Date.now(),
duration_ms: Date.now() - (job.started_compute_at ?? job.started_at)
}
}
}}
on:running={(e) => {
console.log('running', e.detail)
let jobId = e.detail
let job = $jobsById[jobId]
if (job && !job.started_compute_at) {

View File

@@ -130,6 +130,8 @@
{@const waitingLen = b?.started_at
? b.started_compute_at
? b.started_compute_at - b?.started_at
: b.duration_ms
? 0
: now - b?.started_at
: 0}
<div class="flex w-full">