Add batch progress counter

This commit is contained in:
Nayam Amarshe
2023-09-09 17:48:00 +05:30
parent a03d70a938
commit 883171a99f
3 changed files with 17 additions and 1 deletions

View File

@@ -7,12 +7,20 @@ function ProgressBar({
stopHandler,
batchMode,
}) {
const [batchProgress, setBatchProgress] = React.useState(0);
React.useEffect(() => {
if (progress.includes("0.00%")) {
setBatchProgress((prev) => prev + 1);
}
}, [progress]);
return (
<div className="absolute flex h-full w-full flex-col items-center justify-center bg-base-300/50 backdrop-blur-lg">
<div className="flex flex-col items-center gap-2">
<Spinner />
<p className="rounded-full bg-base-300 px-2 py-1 font-bold">
{batchMode && "In Progress"}
{batchMode && "Batch Upscale In Progress: " + batchProgress}
{!batchMode &&
(doubleUpscaylCounter > 0
? `${progress}\nPass ${doubleUpscaylCounter}`