From afc878b37e980c731e7dce8b64a2511f538141fa Mon Sep 17 00:00:00 2001 From: chrischristiansen-glitch Date: Mon, 15 Jun 2026 05:11:05 +0200 Subject: [PATCH] =?UTF-8?q?feat(terminal):=20koble=20frontend=20til=20POST?= =?UTF-8?q?=20/terminal/exec=20=E2=80=94=20ukjente=20kommandoar=20via=20ba?= =?UTF-8?q?ckend?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated default case to handle command execution via fetch. --- static/opax.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/opax.html b/static/opax.html index c53b118..ac07f88 100644 --- a/static/opax.html +++ b/static/opax.html @@ -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) - \ No newline at end of file +