From 5f218f6d40c051bf63bb44ed33d758f9bd6f4efd Mon Sep 17 00:00:00 2001 From: Malte Bublitz Date: Wed, 8 Nov 2023 19:58:13 +0100 Subject: [PATCH] Web-UI: Added multi line input --- fifo-webui/command.php | 15 +++++++++++++- fifo-webui/index.php | 15 ++++++++++++++ fifo-webui/style.css | 45 +++++++++++++++++++++--------------------- 3 files changed, 52 insertions(+), 23 deletions(-) diff --git a/fifo-webui/command.php b/fifo-webui/command.php index 6c3e644..4dad2ee 100644 --- a/fifo-webui/command.php +++ b/fifo-webui/command.php @@ -9,7 +9,10 @@ if (!file_exists(FIFO)) $f = fopen(FIFO, "w+"); -switch ($_POST["cmd"]) { +if (count($_POST) == 0) + $_POST = json_decode(file_get_contents('php://input'), true); + +switch (@$_POST["cmd"]) { case "getty": fwrite($f, "GETTY"); break; @@ -36,6 +39,16 @@ switch ($_POST["cmd"]) { fwrite($f, "ECHO "); fwrite($f, $_POST["text"]); break; + case "echo2": + fwrite($f, "CLS\n"); + fwrite($f, "LINE 1\n"); + fwrite($f, "ECHO "); + fwrite($f, $_POST["line1"]); + fwrite($f, "\n"); + fwrite($f, "LINE 2\n"); + fwrite($f, "ECHO "); + fwrite($f, $_POST["line2"]); + break; } fwrite($f, "\n"); diff --git a/fifo-webui/index.php b/fifo-webui/index.php index ac93af2..17df021 100644 --- a/fifo-webui/index.php +++ b/fifo-webui/index.php @@ -15,18 +15,21 @@ $Title = "MAPID-FIFO Web-UI";
+

Welcome message

+

Clear screen

+

Control LED

@@ -37,6 +40,7 @@ $Title = "MAPID-FIFO Web-UI";
+

Control display

@@ -47,6 +51,7 @@ $Title = "MAPID-FIFO Web-UI";
+

Line selection for output

+
+

Multi line output

+
+ +
+ + +
+