summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics
diff options
context:
space:
mode:
authorSimon Rettberg2019-12-10 18:18:28 +0100
committerSimon Rettberg2019-12-10 18:18:28 +0100
commitb497d4a7200591e0b7b91948120cbfa395f5c92f (patch)
tree6e384142228882f422a3766c8e8598034f323dc2 /modules-available/statistics
parent[rebootcontrol] Fix jumphost script template (missing %) (diff)
downloadslx-admin-b497d4a7200591e0b7b91948120cbfa395f5c92f.tar.gz
slx-admin-b497d4a7200591e0b7b91948120cbfa395f5c92f.tar.xz
slx-admin-b497d4a7200591e0b7b91948120cbfa395f5c92f.zip
[statistics/rebootcontrol] Add remote exec UI
Diffstat (limited to 'modules-available/statistics')
-rw-r--r--modules-available/statistics/page.inc.php4
-rw-r--r--modules-available/statistics/pages/list.inc.php2
-rw-r--r--modules-available/statistics/templates/clientlist.html6
3 files changed, 12 insertions, 0 deletions
diff --git a/modules-available/statistics/page.inc.php b/modules-available/statistics/page.inc.php
index ff5a59cd..533a9bf9 100644
--- a/modules-available/statistics/page.inc.php
+++ b/modules-available/statistics/page.inc.php
@@ -74,6 +74,10 @@ class Page_Statistics extends Page
$this->rebootControl(false);
} elseif ($action === 'wol') {
$this->wol();
+ } elseif ($action === 'prepare-exec') {
+ if (Module::isAvailable('rebootcontrol')) {
+ RebootControl::prepareExec();
+ }
}
// Make sure we don't render any content for POST requests - should be handled above and then
diff --git a/modules-available/statistics/pages/list.inc.php b/modules-available/statistics/pages/list.inc.php
index f223dfb2..e2e7ff09 100644
--- a/modules-available/statistics/pages/list.inc.php
+++ b/modules-available/statistics/pages/list.inc.php
@@ -60,6 +60,7 @@ class SubPage
$rebootAllowedLocations = User::getAllowedLocations('.rebootcontrol.action.reboot');
$shutdownAllowedLocations = User::getAllowedLocations('.rebootcontrol.action.reboot');
$wolAllowedLocations = User::getAllowedLocations('.rebootcontrol.action.wol');
+ $execAllowedLocations = User::getAllowedLocations('.rebootcontrol.action.exec');
// Only make client clickable if user is allowed to view details page
$detailsAllowedLocations = User::getAllowedLocations("machine.view-details");
while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
@@ -125,6 +126,7 @@ class SubPage
'canShutdown' => !empty($shutdownAllowedLocations),
'canDelete' => !empty($deleteAllowedLocations),
'canWol' => !empty($wolAllowedLocations),
+ 'canExec' => !empty($execAllowedLocations),
);
Render::addTemplate('clientlist', $data);
}
diff --git a/modules-available/statistics/templates/clientlist.html b/modules-available/statistics/templates/clientlist.html
index 6ff9bac7..47be4dd0 100644
--- a/modules-available/statistics/templates/clientlist.html
+++ b/modules-available/statistics/templates/clientlist.html
@@ -178,6 +178,12 @@
{{lang_wakeOnLan}}
</button>
{{/canWol}}
+ {{#canExec}}
+ <button type="submit" name="action" value="prepare-exec" class="btn btn-primary btn-machine-action">
+ <span class="glyphicon glyphicon-play"></span>
+ {{lang_remoteExec}}
+ </button>
+ {{/canExec}}
{{/rebootcontrol}}
{{#canDelete}}
<button type="submit" name="action" value="delmachines" class="btn btn-danger btn-machine-action"