create admin form
All checks were successful
App Image CI / Build app image (push) Successful in 37s
NPM Audit Check / Check NPM audit (push) Successful in -2m8s

This commit is contained in:
2025-11-01 00:31:52 -05:00
parent f5c9d8c0c4
commit 77ea3018c1
7 changed files with 85 additions and 6 deletions

28
scripts/form.js Normal file
View File

@@ -0,0 +1,28 @@
document.addEventListener('DOMContentLoaded', function () {
const submit = document.getElementById('submitbtn');
submit.addEventListener('click', async () => {
submit.disabled = true;
const action = submit.parentElement.action;
try {
const resp = await fetch(action, {
method: 'POST',
body: JSON.stringify({
os: document.getElementById('os-select').value,
form: document.getElementById('form-select').value
}),
headers: {
"Content-Type": "application/json",
}
});
if (!resp.ok) {
throw new Error(`Response status: ${resp.status}`);
}
location.reload();
return false;
}
catch (error) {
console.error(error.message);
alert(error.message);
}
});
});