summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-12-17 15:34:10 +0100
committerSimon Rettberg2019-12-17 15:34:10 +0100
commit12dff57b1c293b62b3cc3639638b0f577997383b (patch)
tree9b3e050a2fea4e5cfe242f38b4b0f5d75dae9af2
parent[statistics] Fix Steffens superpatch (diff)
downloadslx-admin-12dff57b1c293b62b3cc3639638b0f577997383b.tar.gz
slx-admin-12dff57b1c293b62b3cc3639638b0f577997383b.tar.xz
slx-admin-12dff57b1c293b62b3cc3639638b0f577997383b.zip
[statistics] Add WOL/exec button to machine details
-rw-r--r--modules-available/statistics/pages/machine.inc.php4
-rw-r--r--modules-available/statistics/templates/machine-main.html42
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}}
<tr>
<td class="text-nowrap">
- {{lang_reboot}}/{{lang_shutdown}}
+ {{lang_remoteActions}}
</td>
<td>
<form method="post" action="?do=statistics">
<input type="hidden" name="token" value="{{token}}">
<input type="hidden" name="uuid" value="{{machineuuid}}">
- {{#canShutdown}}
- <button type="button" class="btn btn-sm btn-danger btn-machine-action" data-toggle="modal"
- data-target="#shutdown-confirm">
- <span class="glyphicon glyphicon-off"></span>
- {{lang_shutdown}}
+ <div class="slx-smallspace">
+ {{#canShutdown}}
+ <button type="button" class="btn btn-sm btn-danger btn-machine-action" data-toggle="modal"
+ data-target="#shutdown-confirm">
+ <span class="glyphicon glyphicon-off"></span>
+ {{lang_shutdown}}
+ </button>
+ {{/canShutdown}}
+ {{#canReboot}}
+ <button type="button" class="btn btn-sm btn-warning btn-machine-action" data-toggle="modal"
+ data-target="#reboot-confirm">
+ <span class="glyphicon glyphicon-repeat"></span>
+ {{lang_reboot}}
+ </button>
+ {{/canReboot}}
+ </div>
+ <div>
+ {{#canWol}}
+ <button type="submit" name="action" value="wol" class="btn btn-sm btn-primary btn-machine-action">
+ <span class="glyphicon glyphicon-bell"></span>
+ {{lang_wakeOnLan}}
</button>
- {{/canShutdown}}
- {{#canReboot}}
- <button type="button" class="btn btn-sm btn-warning btn-machine-action" data-toggle="modal"
- data-target="#reboot-confirm">
- <span class="glyphicon glyphicon-repeat"></span>
- {{lang_reboot}}
+ {{/canWol}}
+ {{#canExec}}
+ <button type="submit" name="action" value="prepare-exec" class="btn btn-sm btn-primary btn-machine-action">
+ <span class="glyphicon glyphicon-play"></span>
+ {{lang_remoteExec}}
</button>
- {{/canReboot}}
+ {{/canExec}}
+ </div>
<div class="modal fade" id="reboot-confirm" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">