From 21f703b5a9e97dbdf4e41329d498fe67ca4d7ef7 Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 8 Oct 2023 19:21:43 +0200 Subject: [PATCH] Ajaxify system reboot/shutdown --- ajax/system/sys_actions.php | 21 +++++++++++++++++++++ app/js/custom.js | 9 +++++++++ includes/system.php | 9 --------- templates/system/basic.php | 4 ++-- 4 files changed, 32 insertions(+), 11 deletions(-) create mode 100644 ajax/system/sys_actions.php diff --git a/ajax/system/sys_actions.php b/ajax/system/sys_actions.php new file mode 100644 index 00000000..ec7aef16 --- /dev/null +++ b/ajax/system/sys_actions.php @@ -0,0 +1,21 @@ +addMessage("System Rebooting Now!", "warning", false); - $result = shell_exec("sudo /sbin/reboot"); - } - if (isset($_POST['system_shutdown'])) { - $status->addMessage("System Shutting Down Now!", "warning", false); - $result = shell_exec("sudo /sbin/shutdown -h now"); - } } if (isset($_POST['RestartLighttpd'])) { diff --git a/templates/system/basic.php b/templates/system/basic.php index 81adb6d2..50a9a66f 100644 --- a/templates/system/basic.php +++ b/templates/system/basic.php @@ -55,8 +55,8 @@ include('includes/sysstats.php');
- " /> - " /> + " /> + " />