This commit is contained in:
mike
2026-06-27 23:01:16 +02:00
parent 52ae51fef3
commit 2ada5fb559
8 changed files with 282 additions and 105 deletions

View File

@@ -80,6 +80,11 @@
<div id="archivedList">No archived items found.</div>
</div>
<div class="section">
<h2>Missing Group IDs <span class="info">(Legacy or orphaned images with no group assigned)</span></h2>
<div id="orphansList">No images with missing groups found.</div>
</div>
<div class="section">
<h2>Orphaned Records <span class="info">(In DB, but file missing on disk)</span></h2>
<div id="missingList">No orphaned records found.</div>
@@ -118,6 +123,7 @@
else if (d.status === 'imported') msg = 'File imported';
else if (d.status === 'restored') msg = 'Item restored';
else if (d.status === 'deleted_permanently') msg = 'Permanently deleted';
else if (d.status === 'assigned') msg = 'Group assigned';
showToast(msg);
loadInconsistencies();
@@ -137,6 +143,7 @@
renderArchived(d.archived_items || []);
renderMissing(d.missing_files || []);
renderUntracked(d.untracked_files || []);
renderOrphans(d.missing_group || []);
if (d.timestamp) {
const date = new Date(d.timestamp * 1000);
@@ -150,6 +157,23 @@
}
}
function renderOrphans(files) {
const container = document.getElementById('orphansList');
if (files.length === 0) {
container.innerHTML = 'No images with missing groups found.';
return;
}
container.innerHTML = files.map(f => `
<div class="item">
<div>
<div class="filename">${f.filename}</div>
<div class="info">Name: ${f.name || 'none'}</div>
</div>
<button class="btn success" onclick="repair('${f.filename}', 'assign_group')">Auto-assign Group</button>
</div>
`).join('');
}
function renderArchived(files) {
const container = document.getElementById('archivedList');
if (files.length === 0) {