web/queue: make completedWorkers into set, require pipelineResults
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
return 100;
|
||||
} else if (item.state === "running") {
|
||||
return totalItemProgress(
|
||||
item.completedWorkers?.length || 0,
|
||||
item.completedWorkers.size,
|
||||
$currentTasks[item.runningWorker]?.progress?.percentage || 0,
|
||||
item.pipeline.length || 0
|
||||
);
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
const starting = $t(`queue.state.starting.${runningWorker.type}`);
|
||||
|
||||
if (info.pipeline.length > 1) {
|
||||
const currentPipeline = (info.completedWorkers?.length || 0) + 1;
|
||||
const currentPipeline = info.completedWorkers.size + 1;
|
||||
return `${starting} (${currentPipeline}/${info.pipeline.length})`;
|
||||
}
|
||||
return starting;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
export let percentage: number = 0;
|
||||
export let workerId: string;
|
||||
export let runningWorkerId: string | undefined;
|
||||
export let completedWorkers: string[] = [];
|
||||
export let completedWorkers: Set<string>;
|
||||
</script>
|
||||
|
||||
<div class="file-progress">
|
||||
@@ -13,7 +13,7 @@
|
||||
class="progress"
|
||||
style="width: {Math.min(100, percentage || 0)}%"
|
||||
></div>
|
||||
{:else if completedWorkers?.includes(workerId)}
|
||||
{:else if completedWorkers.has(workerId)}
|
||||
<div
|
||||
class="progress"
|
||||
style="width: 100%"
|
||||
|
||||
Reference in New Issue
Block a user