Fix watchlist refresh progress fill

This commit is contained in:
Dymas
2026-08-18 19:56:38 +02:00
parent ba8e55bd97
commit 3e95252eb4
5 changed files with 18 additions and 8 deletions
+9 -5
View File
@@ -283,8 +283,10 @@ WATCHLIST_HTML = r"""<!doctype html>
background: linear-gradient(90deg, var(--accent), var(--accent-2));
border-radius: inherit;
height: 100%;
transition: width 0.2s ease;
width: 0%;
transform: scaleX(0);
transform-origin: left center;
transition: transform 0.2s ease;
width: 100%;
}
.refresh-progress-current {
color: #ddd0ff;
@@ -759,7 +761,7 @@ WATCHLIST_HTML = r"""<!doctype html>
<span>Refresh progress</span>
<span id="refreshJobCount">0 / 0</span>
</div>
<div class="refresh-progress-track" aria-hidden="true">
<div class="refresh-progress-track" aria-valuemax="100" aria-valuemin="0" aria-valuenow="0" role="progressbar">
<div class="refresh-progress-fill" id="refreshJobFill"></div>
</div>
<div class="refresh-progress-current" id="refreshJobCurrent"></div>
@@ -926,7 +928,8 @@ WATCHLIST_HTML = r"""<!doctype html>
if (!el) return;
if (!job) {
el.classList.remove("visible");
$("refreshJobFill").style.width = "0%";
$("refreshJobFill").style.transform = "scaleX(0)";
el.querySelector(".refresh-progress-track").setAttribute("aria-valuenow", "0");
$("refreshJobCount").textContent = "0 / 0";
$("refreshJobCurrent").textContent = "";
return;
@@ -935,7 +938,8 @@ WATCHLIST_HTML = r"""<!doctype html>
const total = Number(job.total || 0);
const percent = refreshJobPercent(job);
el.classList.toggle("visible", job.status === "running" || job.status === "pending");
$("refreshJobFill").style.width = `${percent}%`;
$("refreshJobFill").style.transform = `scaleX(${percent / 100})`;
el.querySelector(".refresh-progress-track").setAttribute("aria-valuenow", String(percent));
$("refreshJobCount").textContent = `${completed} / ${total}`;
if (job.status === "pending") {
$("refreshJobCurrent").textContent = job.message || "Waiting to start refresh.";