[Ingest] Persistent crawl run-log + per-source breakdown on admin queue
Each ingestion run now records an IngestionRun row (found/queued/published/flagged/spam/duplicates + a per-source detail string). Admin → صف آگهیها shows a «تاریخچه جمعآوری» table of the last 15 runs (hover a row for the per-source breakdown), so admins can see how much each source found vs added over time. IngestionSummary gains TotalFetched. Migration: IngestionRuns table. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -62,6 +62,40 @@
|
||||
</aside>
|
||||
|
||||
<div>
|
||||
@if (Model.Runs.Count > 0)
|
||||
{
|
||||
<h2 style="font-size:20px; margin-top:0;">تاریخچه جمعآوری</h2>
|
||||
<div class="card card-pad" style="margin-bottom:18px; overflow-x:auto;">
|
||||
<table style="width:100%; border-collapse:collapse; font-size:13px; white-space:nowrap;">
|
||||
<thead>
|
||||
<tr style="text-align:start; color:var(--muted);">
|
||||
<th style="padding:6px 8px;">زمان</th>
|
||||
<th style="padding:6px 8px;">یافتشده</th>
|
||||
<th style="padding:6px 8px;">صف</th>
|
||||
<th style="padding:6px 8px;">منتشر</th>
|
||||
<th style="padding:6px 8px;">پرچم</th>
|
||||
<th style="padding:6px 8px;">اسپم</th>
|
||||
<th style="padding:6px 8px;">تکراری</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var run in Model.Runs)
|
||||
{
|
||||
<tr style="border-top:1px solid var(--line);" title="@run.Detail">
|
||||
<td style="padding:6px 8px;">@JalaliDate.ToLongDate(DateOnly.FromDateTime(run.RunAt)) @run.RunAt.ToString("HH:mm")</td>
|
||||
<td style="padding:6px 8px;">@JalaliDate.ToPersianDigits(run.Fetched.ToString())</td>
|
||||
<td style="padding:6px 8px;">@JalaliDate.ToPersianDigits(run.Queued.ToString())</td>
|
||||
<td style="padding:6px 8px; color:var(--primary-dark); font-weight:700;">@JalaliDate.ToPersianDigits(run.Published.ToString())</td>
|
||||
<td style="padding:6px 8px;">@JalaliDate.ToPersianDigits(run.Flagged.ToString())</td>
|
||||
<td style="padding:6px 8px;">@JalaliDate.ToPersianDigits(run.Spam.ToString())</td>
|
||||
<td style="padding:6px 8px;">@JalaliDate.ToPersianDigits(run.Duplicates.ToString())</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="muted" style="font-size:11px; margin:8px 0 0;">جزئیات هر منبع را با نگهداشتن نشانگر روی هر ردیف ببین. لاگ کامل: <code dir="ltr">docker logs hamkadr_api</code></p>
|
||||
</div>
|
||||
}
|
||||
<h2 style="font-size:20px; margin-top:0;">صف بررسی</h2>
|
||||
@if (Model.Queue.Count == 0)
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@ public class IndexModel : PageModel
|
||||
public IReadOnlyList<string> SourceNames { get; private set; } = new List<string>();
|
||||
public int PublishedShifts { get; private set; }
|
||||
public int PublishedJobs { get; private set; }
|
||||
public List<IngestionRun> Runs { get; private set; } = new();
|
||||
|
||||
[BindProperty] public string? SourceChannel { get; set; }
|
||||
[BindProperty] public string? RawText { get; set; }
|
||||
@@ -67,5 +68,6 @@ public class IndexModel : PageModel
|
||||
SourceNames = _ingest.SourceNames;
|
||||
PublishedShifts = await _db.Shifts.CountAsync(s => s.Source != ShiftSource.Direct);
|
||||
PublishedJobs = await _db.JobOpenings.CountAsync();
|
||||
Runs = await _db.IngestionRuns.OrderByDescending(r => r.RunAt).Take(15).ToListAsync();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user