mirror of
https://github.com/myronblair/jarvis
synced 2026-06-30 17:50:23 -05:00
revert: restore admin/index.php to pre-login-fix state
This commit is contained in:
@@ -943,7 +943,7 @@ select.filter-sel:focus{border-color:var(--cyan)}
|
||||
|
||||
<div id="toast"></div>
|
||||
|
||||
<script data-cfasync="false">
|
||||
<script>
|
||||
// ── UTILS ─────────────────────────────────────────────────────────────────────
|
||||
let _alertFilter = 'active';
|
||||
let _modalCb = null;
|
||||
@@ -993,22 +993,15 @@ function statusBadge(s) {
|
||||
|
||||
// ── AUTH ──────────────────────────────────────────────────────────────────────
|
||||
async function doLogin() {
|
||||
const btn=document.querySelector('#loginBox .btn');
|
||||
const err=document.getElementById('loginErr');
|
||||
const u=document.getElementById('lu').value.trim(), p=document.getElementById('lp').value;
|
||||
if (!u||!p){err.textContent='Enter username and password';return;}
|
||||
btn.disabled=true; btn.textContent='AUTHENTICATING...'; err.textContent='';
|
||||
try {
|
||||
const fd=new FormData(); fd.append('action','login'); fd.append('username',u); fd.append('password',p);
|
||||
const r = await fetch(location.href,{method:'POST',body:fd});
|
||||
const d = await r.json();
|
||||
if (d.error) { err.textContent=d.error; return; }
|
||||
document.getElementById('loginWrap').style.display='none';
|
||||
document.getElementById('app').style.display='flex';
|
||||
document.getElementById('adminUser').textContent = (d.name||u).toUpperCase();
|
||||
initApp();
|
||||
} catch(e) { err.textContent='Connection error — try again'; }
|
||||
finally { btn.disabled=false; btn.textContent='AUTHENTICATE'; }
|
||||
const fd=new FormData(); fd.append('action','login'); fd.append('username',u); fd.append('password',p);
|
||||
const r = await fetch(location.href,{method:'POST',body:fd});
|
||||
const d = await r.json();
|
||||
if (d.error) { document.getElementById('loginErr').textContent=d.error; return; }
|
||||
document.getElementById('loginWrap').style.display='none';
|
||||
document.getElementById('app').style.display='flex';
|
||||
document.getElementById('adminUser').textContent = (d.name||u).toUpperCase();
|
||||
initApp();
|
||||
}
|
||||
|
||||
async function doLogout() {
|
||||
|
||||
Reference in New Issue
Block a user