From 4a9fc2df3ab097f01ec838677876427470524e4d Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Sun, 8 Feb 2026 12:35:37 -0500 Subject: [PATCH] feat(web): add shutdown button to Quick Actions (#234) Add a "Shutdown System" button to the Overview page that gracefully powers off the Raspberry Pi. Uses sudo poweroff, consistent with the existing reboot_system action, letting sudo's secure_path handle binary resolution. Co-authored-by: Chuck Co-authored-by: Claude Opus 4.5 --- web_interface/blueprints/api_v3.py | 3 +++ web_interface/templates/v3/partials/overview.html | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/web_interface/blueprints/api_v3.py b/web_interface/blueprints/api_v3.py index c0f65dcd..9bb73df8 100644 --- a/web_interface/blueprints/api_v3.py +++ b/web_interface/blueprints/api_v3.py @@ -1339,6 +1339,9 @@ def execute_system_action(): elif action == 'reboot_system': result = subprocess.run(['sudo', 'reboot'], capture_output=True, text=True) + elif action == 'shutdown_system': + result = subprocess.run(['sudo', 'poweroff'], + capture_output=True, text=True) elif action == 'git_pull': # Use PROJECT_ROOT instead of hardcoded path project_dir = str(PROJECT_ROOT) diff --git a/web_interface/templates/v3/partials/overview.html b/web_interface/templates/v3/partials/overview.html index 7e8c30b8..36af1300 100644 --- a/web_interface/templates/v3/partials/overview.html +++ b/web_interface/templates/v3/partials/overview.html @@ -123,6 +123,16 @@ Reboot System + +