From 5ad12c6fe4a63e5e08406283edd27f06c2e8e430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=98=AD?= Date: Wed, 9 Sep 2026 13:54:05 +0800 Subject: [PATCH] fix: improve progress percentage calculation for download status (#13755) --- frontend/src/views/host/file-management/process/index.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/host/file-management/process/index.vue b/frontend/src/views/host/file-management/process/index.vue index 1f94defa7..ac5e07448 100644 --- a/frontend/src/views/host/file-management/process/index.vue +++ b/frontend/src/views/host/file-management/process/index.vue @@ -49,7 +49,7 @@ /> {}; const getStatus = (value: DownloadProcess) => value.status || (value.percent === 100 ? 'Success' : 'Downloading'); const isActive = (value: DownloadProcess) => ['Downloading', 'Retrying'].includes(getStatus(value)); +const getProgressPercent = (value: DownloadProcess) => { + if (getStatus(value) === 'Success') return 100; + if (!Number.isFinite(value.percent)) return 0; + const maximum = isActive(value) ? 99.99 : 100; + return Number(Math.min(maximum, Math.max(0, value.percent)).toFixed(2)); +}; const getStatusText = (value: DownloadProcess) => { switch (getStatus(value)) { case 'Success':