Initial release MARS_NWE-PCAP 0.4 - Native Administration, Print and Login Edition

This commit is contained in:
2026-11-26 20:22:04 +00:00
commit 7ba7f59b08
51 changed files with 1966 additions and 0 deletions

3
websetup/login.js Normal file
View File

@@ -0,0 +1,3 @@
'use strict';
const form=document.getElementById('login'), error=document.getElementById('loginError');
form.addEventListener('submit',async e=>{e.preventDefault();const button=form.querySelector('button');button.disabled=true;error.textContent='';try{const r=await fetch('/api/login',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({user:document.getElementById('user').value,password:document.getElementById('password').value}),credentials:'same-origin'});const d=await r.json();if(!r.ok)throw Error(d.error||'Anmeldung fehlgeschlagen');location.replace('/');}catch(e){error.textContent=e.message;document.getElementById('password').value='';}finally{button.disabled=false;}});