Add AI-check details modal on worker page and raise backup upload limit
This commit is contained in:
+21
-1
@@ -17,6 +17,7 @@ const STATUS_BADGE = {
|
||||
let state = null;
|
||||
let refreshTimer = null;
|
||||
let busy = false;
|
||||
let recentRows = [];
|
||||
|
||||
function fmtDur(ms) {
|
||||
if (ms === null || ms === undefined || ms < 0) return '—';
|
||||
@@ -141,13 +142,15 @@ function renderRecent() {
|
||||
const empty = document.getElementById('recentEmpty');
|
||||
if (!rows.length) { tbody.innerHTML = ''; empty.style.display = 'block'; return; }
|
||||
empty.style.display = 'none';
|
||||
tbody.innerHTML = rows.map(r => `
|
||||
recentRows = rows;
|
||||
tbody.innerHTML = rows.map((r, i) => `
|
||||
<tr>
|
||||
<td style="white-space:nowrap">${fmtTime(r.ai_checked_at)}</td>
|
||||
<td>${esc(r.student_name)}</td>
|
||||
<td style="color:var(--muted)">${esc(r.group_name || '')}</td>
|
||||
<td>${statusBadge(r.ai_status)}</td>
|
||||
<td>${r.changed ? '✏️ исправлен' : '—'}</td>
|
||||
<td><button type="button" class="ai-details" data-ai-idx="${i}">Подробнее</button></td>
|
||||
</tr>`).join('');
|
||||
}
|
||||
|
||||
@@ -225,6 +228,23 @@ document.getElementById('requeueBtn').addEventListener('click', requeueFailed);
|
||||
document.getElementById('recentFilter').addEventListener('change', renderRecent);
|
||||
document.getElementById('autoRefresh').addEventListener('change', e => setAutoRefresh(e.target.checked));
|
||||
|
||||
document.getElementById('recentTable').addEventListener('click', e => {
|
||||
const btn = e.target.closest('.ai-details');
|
||||
if (!btn) return;
|
||||
const r = recentRows[parseInt(btn.dataset.aiIdx, 10)];
|
||||
if (!r) return;
|
||||
document.getElementById('aiDetailTitle').textContent = `ИИ-проверка #${r.id} — ${r.student_name}`;
|
||||
document.getElementById('aiDetailInput').textContent = r.description_original || '—';
|
||||
document.getElementById('aiDetailOutput').textContent = r.description_ai || '—';
|
||||
document.getElementById('aiDetailModal').classList.add('open');
|
||||
});
|
||||
document.getElementById('aiDetailCloseBtn').addEventListener('click', () => {
|
||||
document.getElementById('aiDetailModal').classList.remove('open');
|
||||
});
|
||||
document.getElementById('aiDetailModal').addEventListener('click', e => {
|
||||
if (e.target === e.currentTarget) e.currentTarget.classList.remove('open');
|
||||
});
|
||||
|
||||
(async () => {
|
||||
if (await requireAdminPage()) {
|
||||
buildSidebar(document.body.dataset.page);
|
||||
|
||||
Reference in New Issue
Block a user