improve app timelines
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user