V10.522 補 PChome backfill coverage 狀態
Some checks failed
CD Pipeline / deploy (push) Failing after 1m5s
Some checks failed
CD Pipeline / deploy (push) Failing after 1m5s
This commit is contained in:
@@ -299,6 +299,22 @@ let priceChartInstance = null;
|
||||
return Number(value || 0).toLocaleString();
|
||||
}
|
||||
|
||||
function formatBackfillRate(value) {
|
||||
const numeric = Number(value || 0);
|
||||
if (!Number.isFinite(numeric)) return '0%';
|
||||
return `${numeric.toFixed(1).replace(/\.0$/, '')}%`;
|
||||
}
|
||||
|
||||
function formatBackfillCoverageSummary(coverage) {
|
||||
if (!coverage || coverage.available === false) return '';
|
||||
return (
|
||||
`身份覆蓋 ${formatBackfillRate(coverage.match_rate)}`
|
||||
+ ` · 新鮮 ${formatBackfillRate(coverage.fresh_match_rate)}`
|
||||
+ ` · 待刷新 ${formatBackfillCount(coverage.stale_matches)}`
|
||||
+ ` · 待補抓 ${formatBackfillCount(coverage.pending)}`
|
||||
);
|
||||
}
|
||||
|
||||
function schedulePchomeBackfillPoll() {
|
||||
if (pchomeBackfillPollTimer) {
|
||||
clearTimeout(pchomeBackfillPollTimer);
|
||||
@@ -314,6 +330,7 @@ let priceChartInstance = null;
|
||||
const currentRun = status.current_run || {};
|
||||
const result = currentRun.result || status.last_result || {};
|
||||
const pickResult = currentRun.pick_result || {};
|
||||
const coverageSummary = formatBackfillCoverageSummary(status.coverage);
|
||||
const running = Boolean(status.running || currentRun.running);
|
||||
const progressPct = Math.max(0, Math.min(Number(status.progress_pct || currentRun.progress_pct || 0), 100));
|
||||
const statusKey = status.status || currentRun.status || 'idle';
|
||||
@@ -337,9 +354,12 @@ let priceChartInstance = null;
|
||||
+ ` · 待覆核 ${formatBackfillCount(result.skipped_low_score)}`
|
||||
+ ` · 無結果 ${formatBackfillCount(result.skipped_no_result)}`
|
||||
+ pickWritten
|
||||
+ (coverageSummary ? ` · ${coverageSummary}` : '')
|
||||
);
|
||||
} else {
|
||||
elements.result.textContent = running ? '正在累積結果' : '尚無最近結果';
|
||||
elements.result.textContent = running
|
||||
? (coverageSummary ? `正在累積結果 · ${coverageSummary}` : '正在累積結果')
|
||||
: (coverageSummary || '尚無最近結果');
|
||||
}
|
||||
}
|
||||
if (elements.trigger) {
|
||||
|
||||
Reference in New Issue
Block a user