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:
parent
64cf2dc1af
commit
afc878b37e
|
|
@ -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') }
|
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') }
|
catch(e){ tprint('Feil: '+e.message,'err') }
|
||||||
break
|
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(){
|
function confirmVmStop(){
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user