From 12dff57b1c293b62b3cc3639638b0f577997383b Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 17 Dec 2019 15:34:10 +0100 Subject: [statistics] Add WOL/exec button to machine details --- modules-available/statistics/pages/machine.inc.php | 4 ++- .../statistics/templates/machine-main.html | 42 +++++++++++++++------- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/modules-available/statistics/pages/machine.inc.php b/modules-available/statistics/pages/machine.inc.php index 9c42160d..7aa91c16 100644 --- a/modules-available/statistics/pages/machine.inc.php +++ b/modules-available/statistics/pages/machine.inc.php @@ -79,7 +79,9 @@ class SubPage if (Module::get('rebootcontrol') !== false) { $client['canReboot'] = (User::hasPermission('.rebootcontrol.action.reboot', (int)$client['locationid'])); $client['canShutdown'] = (User::hasPermission('.rebootcontrol.action.shutdown', (int)$client['locationid'])); - $client['rebootcontrol'] = $client['canReboot'] || $client['canShutdown']; + $client['canWol'] = (User::hasPermission('.rebootcontrol.action.wol', (int)$client['locationid'])); + $client['canExec'] = (User::hasPermission('.rebootcontrol.action.exec', (int)$client['locationid'])); + $client['rebootcontrol'] = $client['canReboot'] || $client['canShutdown'] || $client['canWol'] || $client['canExec']; } // Baseconfig if (Module::get('baseconfig') !== false diff --git a/modules-available/statistics/templates/machine-main.html b/modules-available/statistics/templates/machine-main.html index d0e6b3c1..5e3b31f6 100644 --- a/modules-available/statistics/templates/machine-main.html +++ b/modules-available/statistics/templates/machine-main.html @@ -104,26 +104,42 @@ {{#rebootcontrol}} - {{lang_reboot}}/{{lang_shutdown}} + {{lang_remoteActions}}
- {{#canShutdown}} - + {{/canShutdown}} + {{#canReboot}} + + {{/canReboot}} + +
+ {{#canWol}} + - {{/canShutdown}} - {{#canReboot}} - - {{/canReboot}} + {{/canExec}} +