From 36c2ed13616ebaa1e88cb5753029d65e945bf8b3 Mon Sep 17 00:00:00 2001 From: Qiufeng Date: Thu, 3 Sep 2026 15:02:44 +0800 Subject: [PATCH] fix: show completed download progress --- web-next/src/pages/update/UpdatePage.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web-next/src/pages/update/UpdatePage.tsx b/web-next/src/pages/update/UpdatePage.tsx index 0ed33d1..13b174e 100644 --- a/web-next/src/pages/update/UpdatePage.tsx +++ b/web-next/src/pages/update/UpdatePage.tsx @@ -116,7 +116,9 @@ export default function UpdatePage({ timezone = "Asia/Shanghai", notify }: { tim const sameCompleted = Boolean(job?.status === "completed" && latest && job.version === latest.version); const canDownload = Boolean(info?.strategy === "systemd" && latest?.isNewer && latest.compatible && latest.integrityReady && !hasActiveJob && !sameCompleted && (!job || job.version !== latest.version || job.status === "failed" || job.status === "cancelled")); const canApply = Boolean(info?.strategy === "systemd" && latest?.isNewer && latest.compatible && latest.integrityReady && job?.operation === "download" && job.status === "staged" && job.version === latest.version); - const progress = job?.status === "downloading" && job.sizeBytes && job.downloadedBytes !== null && job.downloadedBytes !== undefined + const progress = job?.status === "staged" && job.operation === "download" + ? 100 + : job?.status === "downloading" && job.sizeBytes && job.downloadedBytes !== null && job.downloadedBytes !== undefined ? Math.min(99, Math.max(8, Math.round(job.downloadedBytes / job.sizeBytes * 100))) : job ? ({ queued: 8, downloading: 28, verifying: 48, staged: 65, backing_up: 80, applying: 92 } as Partial>)[job.status] ?? 100 : 0; const notes = latest ? notesFor(latest) : null;