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;