Group search results by owner; auto-resume stuck pending documents

This commit is contained in:
Krikorios
2026-05-07 21:59:29 +03:00
parent 631a4c3e3d
commit 60eb58cc9f
6 changed files with 80 additions and 13 deletions
+22
View File
@@ -58,6 +58,12 @@
</div>
{% endif %}
{% if stats.processing %}
<div class="alert-banner">
<button class="btn btn-sm btn-primary" onclick="resumePending(this)">استئناف معالجة الوثائق المعلّقة ({{ stats.processing }})</button>
</div>
{% endif %}
{% if stats.pending_review %}
<div class="alert-banner">
<a href="/review/next">ابدأ مراجعة {{ stats.pending_review }} وثيقة →</a>
@@ -182,6 +188,22 @@ async function retryAllErrors(btn) {
}
}
async function resumePending(btn) {
btn.disabled = true;
const original = btn.textContent;
btn.textContent = 'جارٍ الاستئناف...';
const res = await fetch('/documents/resume-pending', { method: 'POST' });
if (res.ok) {
const data = await res.json();
alert(`تم استئناف ${data.resumed} وثيقة. قد تستغرق المعالجة بضع لحظات.`);
location.reload();
} else {
alert('فشل الاستئناف.');
btn.disabled = false;
btn.textContent = original;
}
}
async function scanDuplicates(btn) {
btn.disabled = true;
const original = btn.textContent;
+1 -1
View File
@@ -144,7 +144,7 @@
{% else %}
<div class="persons-grid">
{% for p in persons %}
<a href="/persons/{{ p.id }}{% if p.search_scope %}?search_scope={{ p.search_scope|urlencode }}{% endif %}" class="person-card">
<a href="/persons/{{ p.id }}" class="person-card">
<div class="person-name">{{ p.first_name }} {{ p.father_name or '' }} {{ p.family_name or '' }}</div>
<div class="person-meta">
{% if p.family_origin %}{{ p.family_origin }} · {% endif %}