From f46ef3a43c33ba4d53698d99853fb91806c33c3c Mon Sep 17 00:00:00 2001 From: d00f <8052722+DrDoof@users.noreply.github.com> Date: Wed, 12 Aug 2026 22:06:33 +0200 Subject: [PATCH] system: show what the console command printed The console tab posts to /cmd and throws the response away, so the page stayed silent whether the command worked, was refused or was just misspelt. Now that /cmd answers with the command's output, the page keeps a running transcript: each command echoed after a prompt, then whatever it printed. The box is a pre element filled through textContent, so nothing the device prints is taken for markup. It scrolls to the newest line and the input clears after a send. --- html/system.html | 2 ++ html/system.js | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/html/system.html b/html/system.html index 9c07fdc1..f538d3ee 100644 --- a/html/system.html +++ b/html/system.html @@ -88,6 +88,8 @@


Be careful when entering console commands, you can lock yourself out!
+
+

 
     
 
diff --git a/html/system.js b/html/system.js
index f9fd37eb..0160b8b2 100644
--- a/html/system.js
+++ b/html/system.js
@@ -35,14 +35,19 @@ async function ipSub() {
 }
 
 async function cmdSub() {
-  var cmd = document.getElementById('console_cmd').value;
+  const input = document.getElementById('console_cmd');
+  const out = document.getElementById('console_out');
+  const cmd = input.value;
   try {
     const response = await fetch('/cmd', {
       method: 'POST',
       body: cmd
     });
-    console.log('Completed!', response);
+    out.textContent += "> " + cmd + "\n" + await response.text();
+    out.scrollTop = out.scrollHeight;
+    input.value = "";
   } catch(err) {
+      out.textContent += "> " + cmd + "\n" + err + "\n";
       console.error(`Error: ${err}`);
   }
 }