From 8c55798e34d04bac8374ef0e20a1afd6757fb992 Mon Sep 17 00:00:00 2001 From: PaulVua Date: Tue, 17 Feb 2026 12:51:39 +0100 Subject: [PATCH] Fix UI: Add button IDs and fix status message selector in screen.html; Capture stderr in launcher.php --- html/launcher.php | 6 +++--- html/screen.html | 19 ++++++++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/html/launcher.php b/html/launcher.php index 407c436..1f62403 100755 --- a/html/launcher.php +++ b/html/launcher.php @@ -1760,8 +1760,8 @@ if ($type == "screen_control") { shell_exec($command); echo "Started"; } elseif ($action == "stop") { - $command = 'sudo pkill -f "screen.py"'; - shell_exec($command); - echo "Stopped"; + $command = 'sudo pkill -f "screen.py" 2>&1'; + $output = shell_exec($command); + echo "Stopped. Output: " . $output; } } diff --git a/html/screen.html b/html/screen.html index 7716c80..14b49f6 100644 --- a/html/screen.html +++ b/html/screen.html @@ -69,7 +69,7 @@
Actions

Démarrer ou arrêter l'application d'affichage sur l'écran HDMI.

- -
'); + $('#startBtn').removeClass('btn-success').addClass('btn-secondary').prop('disabled', true); + $('#stopBtn').removeClass('btn-secondary').addClass('btn-danger').prop('disabled', false); + $('#status-message').html('
L\'écran a été démarré. Réponse: ' + response + '
'); } else { - $('#status-message').html(''); + $('#startBtn').removeClass('btn-secondary').addClass('btn-success').prop('disabled', false); + $('#stopBtn').removeClass('btn-danger').addClass('btn-secondary').prop('disabled', true); + $('#status-message').html('
L\'écran a été arrêté. Réponse: ' + response + '
'); } }, error: function (xhr, status, error) { - console.error('AJAX request failed:', status, error); - $('#status-message').html(''); + console.error("AJAX Error:", status, error); + $('#status-message').html('
Erreur: ' + error + '
'); } }); }