mirror of
https://github.com/zvx-echo6/recon.git
synced 2026-05-20 06:34:40 +02:00
Fix Kiwix status badges to reflect full pipeline state
Status was showing COMPLETE after ZIM extraction finished, even when documents were still queued for enrichment/embedding. Now computes effective_status by checking actual pipeline state per-source: - DETECTED: ingest not enabled (gray) - EXTRACTING: ZIM processor running (blue) - PROCESSING: extracted but docs still in enricher/embedder queue (amber) - COMPLETE: all docs fully enriched and embedded in Qdrant (green) Also fixed _build_kiwix_sources pipeline query to filter by category per-source instead of returning global kiwix stats for every source. Progress column now shows "X / Y in Qdrant" when processing, or "X / Y extracted" otherwise. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
6f2a1d206e
commit
fed02186fa
3 changed files with 31 additions and 8 deletions
|
|
@ -20,9 +20,15 @@
|
|||
var sources = data.sources || [];
|
||||
var html = '';
|
||||
sources.forEach(function(s) {
|
||||
var pctDone = s.article_count > 0 ? (s.processed_count / s.article_count * 100).toFixed(1) : 0;
|
||||
var statusBadge = s.status === 'complete' ? '<span class="badge-complete">COMPLETE</span>' :
|
||||
s.status === 'ingesting' ? '<span class="badge-ingesting">INGESTING</span>' :
|
||||
var es = s.effective_status || s.status;
|
||||
var pipe = s.pipeline || {};
|
||||
var pipeComplete = pipe.complete || 0;
|
||||
var pipeTotal = 0;
|
||||
for (var k in pipe) pipeTotal += pipe[k];
|
||||
var pctDone = pipeTotal > 0 ? (pipeComplete / pipeTotal * 100).toFixed(1) : 0;
|
||||
var statusBadge = es === 'complete' ? '<span class="badge-complete">COMPLETE</span>' :
|
||||
es === 'processing' ? '<span class="badge-processing">PROCESSING</span>' :
|
||||
es === 'extracting' ? '<span class="badge-extracting">EXTRACTING</span>' :
|
||||
'<span class="badge-detected">DETECTED</span>';
|
||||
// Derive browse URL from zim_filename
|
||||
var zimName = s.zim_filename.replace(/_(?:maxi|mini|nopic)_[\d-]+\.zim$/, '');
|
||||
|
|
@ -38,8 +44,9 @@
|
|||
'<div class="text-small text-muted">' + s.zim_filename + '</div></td>' +
|
||||
'<td>' + (s.language || '\u2014') + '</td>' +
|
||||
'<td>' + RECON.fmt(s.article_count) + '</td>' +
|
||||
'<td>' + RECON.fmt(s.processed_count) + ' / ' + RECON.fmt(s.article_count) +
|
||||
' (' + pctDone + '%)</td>' +
|
||||
'<td>' + (es === 'processing' ?
|
||||
RECON.fmt(pipeComplete) + ' / ' + RECON.fmt(pipeTotal) + ' in Qdrant (' + pctDone + '%)' :
|
||||
RECON.fmt(s.processed_count) + ' / ' + RECON.fmt(s.article_count) + ' extracted') + '</td>' +
|
||||
'<td>' + statusBadge + '</td>' +
|
||||
'<td>' + toggle + '</td>' +
|
||||
'<td><a href="' + browseUrl + '" target="_blank">Browse</a></td>' +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue