mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-28 17:38:31 +00:00
web/ProcessingQueue: use full progress per item, not just running task
This commit is contained in:
parent
398c5402d2
commit
2ae0fd01dd
@ -19,11 +19,20 @@
|
||||
|
||||
$: queue = Object.entries($readableQueue);
|
||||
|
||||
const totalItemProgress = (completed: number, current: number, total: number) => {
|
||||
return (completed * 100 + current) / total
|
||||
}
|
||||
|
||||
$: totalProgress = queue.length ? queue.map(([, item]) => {
|
||||
if (item.state === "done" || item.state === "error")
|
||||
if (item.state === "done" || item.state === "error") {
|
||||
return 100;
|
||||
else if (item.state === "running")
|
||||
return $currentTasks[item.runningWorker]?.progress?.percentage || 0;
|
||||
} else if (item.state === "running") {
|
||||
return totalItemProgress(
|
||||
item.completedWorkers?.length || 0,
|
||||
$currentTasks[item.runningWorker]?.progress?.percentage || 0,
|
||||
item.pipeline.length || 0
|
||||
);
|
||||
}
|
||||
return 0;
|
||||
}).reduce((a, b) => a + b) / (100 * queue.length) : 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user