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 + '
'); } }); }