mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-29 01:48:28 +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);
|
$: queue = Object.entries($readableQueue);
|
||||||
|
|
||||||
|
const totalItemProgress = (completed: number, current: number, total: number) => {
|
||||||
|
return (completed * 100 + current) / total
|
||||||
|
}
|
||||||
|
|
||||||
$: totalProgress = queue.length ? queue.map(([, item]) => {
|
$: totalProgress = queue.length ? queue.map(([, item]) => {
|
||||||
if (item.state === "done" || item.state === "error")
|
if (item.state === "done" || item.state === "error") {
|
||||||
return 100;
|
return 100;
|
||||||
else if (item.state === "running")
|
} else if (item.state === "running") {
|
||||||
return $currentTasks[item.runningWorker]?.progress?.percentage || 0;
|
return totalItemProgress(
|
||||||
|
item.completedWorkers?.length || 0,
|
||||||
|
$currentTasks[item.runningWorker]?.progress?.percentage || 0,
|
||||||
|
item.pipeline.length || 0
|
||||||
|
);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}).reduce((a, b) => a + b) / (100 * queue.length) : 0;
|
}).reduce((a, b) => a + b) / (100 * queue.length) : 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user