diff --git a/public/admin.css b/public/admin.css index 4addc55..5a19c9e 100644 --- a/public/admin.css +++ b/public/admin.css @@ -472,6 +472,19 @@ body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;b .face-empty{color:var(--muted);font-size:.78rem} .face-ref-profile-btn[hidden]{display:none} +/* --- Модалка битых ссылок на фото лиц (#faceBrokenCleanupModal) --- */ +.face-broken-list{max-height:340px;overflow:auto;border:1px solid var(--border);border-radius:8px;background:var(--bg)} +.face-broken-item{display:flex;align-items:center;gap:8px;padding:6px 10px;border-bottom:1px solid var(--border)} +.face-broken-item:last-child{border-bottom:none} +.face-broken-item:hover{background:rgba(0,0,0,.03)} +.face-broken-row{display:flex;align-items:center;gap:8px;width:100%;cursor:pointer} +.face-broken-row input{width:18px;height:18px;flex-shrink:0;margin:0} +.face-broken-info{display:flex;flex-direction:column;min-width:0} +.face-broken-student{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} +.face-broken-path{font-size:.72rem;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap} +.face-broken-table{font-size:.68rem;color:var(--muted);margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} +.face-broken-empty{padding:14px;text-align:center;color:var(--muted)} + /* --- Профиль ученика (#profileDataModal) --- */ .pf-modal{padding:0;max-width:960px;width:min(96vw,960px);max-height:92dvh;overflow:hidden} .pf-form{display:flex;flex-direction:column;min-height:0;max-height:92dvh;gap:0} diff --git a/public/js/settings.js b/public/js/settings.js index d0e0184..1aa0dd0 100644 --- a/public/js/settings.js +++ b/public/js/settings.js @@ -874,7 +874,8 @@ document.getElementById('aiProfilesList').addEventListener('click', e => { document.addEventListener('keydown', e => { if (e.key === 'Escape') { - if (document.getElementById('bkCountsModal').classList.contains('open')) closeBackupCountsModal(); + if (document.getElementById('faceBrokenCleanupModal')?.classList.contains('open')) closeFaceBrokenCleanupModal(); + else if (document.getElementById('bkCountsModal').classList.contains('open')) closeBackupCountsModal(); else if (document.getElementById('aiProfileModal').classList.contains('open')) closeAiProfileForm(); } }); @@ -1456,6 +1457,15 @@ const faceBrokenScanBtn = document.getElementById('faceBrokenScanBtn'); const faceBrokenCleanupBtn = document.getElementById('faceBrokenCleanupBtn'); const faceBrokenStatus = document.getElementById('faceBrokenStatus'); const faceBrokenHint = document.getElementById('faceBrokenHint'); +const faceBrokenCleanupModal = document.getElementById('faceBrokenCleanupModal'); +const faceBrokenList = document.getElementById('faceBrokenList'); +const faceBrokenSelectAllBtn = document.getElementById('faceBrokenSelectAllBtn'); +const faceBrokenSelectNoneBtn = document.getElementById('faceBrokenSelectNoneBtn'); +const faceBrokenSelectCount = document.getElementById('faceBrokenSelectCount'); +const faceBrokenDeleteBtn = document.getElementById('faceBrokenDeleteBtn'); +const faceBrokenDeleteCount = document.getElementById('faceBrokenDeleteCount'); +const faceBrokenCancelBtn = document.getElementById('faceBrokenCancelBtn'); +let faceBrokenItems = []; async function loadFaceBrokenStatus() { if (!faceBrokenStatus) return; @@ -1488,19 +1498,113 @@ if (faceBrokenScanBtn) faceBrokenScanBtn.addEventListener('click', async () => { }); if (faceBrokenCleanupBtn) faceBrokenCleanupBtn.addEventListener('click', async () => { - if (!confirm('Удалить все битые ссылки на фото лиц (эталоны и найденные лица) из базы? Файлы уже удалены, ссылки остаются мёртвыми.')) return; - faceBrokenCleanupBtn.disabled = true; - if (faceBrokenStatus) faceBrokenStatus.textContent = 'Очистка...'; + await openFaceBrokenCleanupModal(); +}); + +async function openFaceBrokenCleanupModal() { + if (!faceBrokenCleanupModal || !faceBrokenList) return; + faceBrokenList.innerHTML = '