feat: detect duplicates in csv

This commit is contained in:
2026-06-08 04:35:22 +01:00
parent 304892552f
commit a0bff2beb1
11 changed files with 390 additions and 118 deletions
+20 -5
View File
@@ -89,7 +89,7 @@
<div class="mt-auto pt-3" style="border-top:1px solid var(--border);">
<div class="nav-link-custom" style="cursor:default;">
<i class="fa-solid fa-circle-user fa-fw"></i>
<span style="font-size:0.82rem;">Admin</span>
<span class="nav-username" style="font-size:0.82rem;">User</span>
</div>
</div>
</div>
@@ -197,10 +197,12 @@
</a>
</div>
<!-- Start Admin Settings -->
<div id="adminSection" class="d-none col-12">
<hr class="mt-4 mb-3">
<div class="page-header mt-0 mb-0">
<div class="page-header mt-0 mb-4">
<p><em>You're seeing these options because you're an admin. Proceed with caution!</em></p>
</div>
<div class="row g-3">
<div class="col-12 col-sm-6">
<a href="admin.html" class="card p-4 border-0 text-decoration-none d-flex flex-row align-items-center gap-3">
<i class="fa-solid fa-user-shield fa-lg" style="color:var(--accent);"></i>
@@ -223,6 +225,8 @@
<i class="fa-solid fa-chevron-right ms-auto" style="color:var(--text-muted);font-size:0.8rem;"></i>
</button>
</div>
</div><!-- /.row (admin cards) -->
</div><!-- /#adminSection -->
</div>
</div>
</div>
@@ -332,12 +336,23 @@
loadStats();
</script>
<script>
(async function () {
async function checkAuth() {
try {
const d = await fetch('/api/admin.php').then(r => r.json());
const r = await fetch('/api/admin.php', { redirect: 'manual' });
if (r.type === 'opaqueredirect' || !r.ok) { window.location.reload(); return; }
const d = await r.json();
document.getElementById('sandboxBanner').style.display = d.sandbox_mode ? '' : 'none';
document.querySelectorAll('.admin-nav-link').forEach(el => el.classList.toggle('d-none', !d.is_admin));
const adminSection = document.getElementById('adminSection');
if (adminSection) adminSection.classList.toggle('d-none', !d.is_admin);
const name = d.name || d.username;
if (name) {
document.querySelectorAll('.nav-username').forEach(el => { el.textContent = name; });
}
} catch { }
}());
}
checkAuth();
document.addEventListener('visibilitychange', () => { if (document.visibilityState === 'visible') checkAuth(); });
</script>
</body>