feat: detect duplicates in csv
This commit is contained in:
+17
-2
@@ -90,7 +90,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>
|
||||
@@ -245,7 +245,21 @@
|
||||
|
||||
async function loadAdmin() {
|
||||
try {
|
||||
const data = await fetch('/api/admin.php').then(r => r.json());
|
||||
const r = await fetch('/api/admin.php', { redirect: 'manual' });
|
||||
if (r.type === 'opaqueredirect') { window.location.reload(); return; }
|
||||
if (!r.ok) { window.location.replace('index.html'); return; }
|
||||
const data = await r.json();
|
||||
|
||||
if (!data.is_admin) {
|
||||
window.location.replace('index.html');
|
||||
return;
|
||||
}
|
||||
|
||||
document.querySelectorAll('.admin-nav-link').forEach(el => el.classList.remove('d-none'));
|
||||
const name = data.name || data.username;
|
||||
if (name) {
|
||||
document.querySelectorAll('.nav-username').forEach(el => { el.textContent = name; });
|
||||
}
|
||||
|
||||
document.getElementById('sandboxToggle').checked = data.sandbox_mode;
|
||||
document.getElementById('sandboxBanner').style.display = data.sandbox_mode ? '' : 'none';
|
||||
@@ -359,6 +373,7 @@
|
||||
// ─── Init ────────────────────────────────────────────────────────────────────
|
||||
|
||||
loadAdmin();
|
||||
document.addEventListener('visibilitychange', () => { if (document.visibilityState === 'visible') loadAdmin(); });
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user