feat(terminal): koble frontend til POST /terminal/exec — ukjente kommandoar via backend

Updated default case to handle command execution via fetch.
This commit is contained in:
chrischristiansen-glitch 2026-06-15 05:11:05 +02:00 committed by GitHub
parent 64cf2dc1af
commit afc878b37e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1047,7 +1047,7 @@ async function termKey(e){
try{ const d=await fetch('/opax/build-status').then(r=>r.json()); tprint(JSON.stringify(d,null,2),'ok') }
catch(e){ tprint('Feil: '+e.message,'err') }
break
default: tprint('Ukjent kommando: '+cmd+' (skriv «help»)','err')
default: try{ const r=await fetch('/terminal/exec',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({command:cmd})}) const d=await r.json() if(d.stdout) tprint(d.stdout,'ok') if(d.stderr) tprint(d.stderr,'err') if(d.returncode!==0&&!d.stdout&&!d.stderr) tprint('Exit '+d.returncode,'err') }catch(err){ tprint('Feil: '+err.message,'err') }
}
}
function confirmVmStop(){
@ -1119,4 +1119,4 @@ renderTierGrid(5000)
updatePricing(5000)
</script>
</body>
</html>
</html>