This commit is contained in:
2026-02-13 23:27:54 +01:00
parent 1825b50dec
commit 1e126734b0
13 changed files with 2743 additions and 3 deletions

View File

@@ -0,0 +1,23 @@
// Login form handler
document.getElementById('login-form').addEventListener('submit', async (e) => {
e.preventDefault();
const username = document.getElementById('username').value;
const password = document.getElementById('password').value;
try {
const res = await fetch('/admin/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ username, password })
});
const data = await res.json();
if (data.success) {
location.reload();
} else {
alert(data.message || 'Login failed');
}
} catch (e) {
alert('Connection error');
}
});