From ba38dd36378878ce323a4138000437f760726fb9 Mon Sep 17 00:00:00 2001 From: qiansc Date: Wed, 4 Nov 2026 13:08:06 +0000 Subject: [PATCH] fix(web): hide collection status until the first round after restart The zero time (0001-01-01) is truthy, so the status line showed a placeholder last-reclaim time; use the shared validTime check. Co-Authored-By: Claude Opus 5.5 --- web/assets/operations-page.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/assets/operations-page.js b/web/assets/operations-page.js index 2448f40..e8bf4b2 100644 --- a/web/assets/operations-page.js +++ b/web/assets/operations-page.js @@ -87,11 +87,11 @@ // Everyone sees the instance that answered; administrators see every instance with a recent heartbeat. // Expired indexes waiting for collection and the latest round's outcome. function collectionLine(c){ - if(!c||!c.last_run_at)return ''; + if(!c||!A.validTime(c.last_run_at))return ''; const reasons={round_budget_exhausted:t('本轮时间用尽','round budget used up'),registry_unavailable:t('读取仓库记录失败','registry unavailable'),remove_failed:t('删除文件失败','file removal failed'),manifest_scan_failed:t('扫描索引清单失败','manifest scan failed')}; const pending=c.pending_generations?t('待回收索引 '+c.pending_generations+' 个 · '+M.bytes(c.pending_bytes),c.pending_generations+' expired indexes · '+M.bytes(c.pending_bytes)):t('无待回收索引','No expired indexes'); const busy=c.busy_repositories?t(','+c.busy_repositories+' 个仓库忙碌顺延',', '+c.busy_repositories+' busy, deferred'):''; - const last=c.last_reclaim_at?t(';上次回收 '+ago(c.last_reclaim_at),'; last reclaimed '+ago(c.last_reclaim_at)):''; + const last=A.validTime(c.last_reclaim_at)?t(';上次回收 '+ago(c.last_reclaim_at),'; last reclaimed '+ago(c.last_reclaim_at)):''; const err=c.last_error?''+t(';最近问题:','; last issue: ')+esc(reasons[c.last_error]||c.last_error)+'':''; return '
'+esc(pending+busy+last)+err+'
'; }