summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/page.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2022-07-06 15:56:29 +0200
committerSimon Rettberg2022-07-06 15:56:29 +0200
commitae128c579ba1b06ee740ea5f07919cf4f33f340f (patch)
treeebdad61ec014babaffedf9bcc541b7fc179c33c6 /modules-available/statistics/page.inc.php
parent[dnbd3/vmstore] Add selection for DNBD3 server, or NFS mode, show any errors (diff)
downloadslx-admin-ae128c579ba1b06ee740ea5f07919cf4f33f340f.tar.gz
slx-admin-ae128c579ba1b06ee740ea5f07919cf4f33f340f.tar.xz
slx-admin-ae128c579ba1b06ee740ea5f07919cf4f33f340f.zip
[statistics] Fix Chart.js for HDD view
Diffstat (limited to 'modules-available/statistics/page.inc.php')
-rw-r--r--modules-available/statistics/page.inc.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/modules-available/statistics/page.inc.php b/modules-available/statistics/page.inc.php
index 04d9a515..71c9dea3 100644
--- a/modules-available/statistics/page.inc.php
+++ b/modules-available/statistics/page.inc.php
@@ -91,6 +91,8 @@ class Page_Statistics extends Page
$this->rebootControl(false);
} elseif ($action === 'wol') {
$this->wol();
+ } elseif ($action === 'benchmark') {
+ $this->vmstoreBenchmark();
} elseif ($action === 'prepare-exec') {
if (Module::isAvailable('rebootcontrol')) {
RebootControl::prepareExec();
@@ -169,6 +171,25 @@ class Page_Statistics extends Page
}
}
+ /**
+ * @param bool $reboot true = reboot, false = shutdown
+ */
+ private function vmstoreBenchmark()
+ {
+ if (!Module::isAvailable('vmstore'))
+ return;
+ $ids = Request::post('uuid', [], 'array');
+ $ids = array_values($ids);
+ if (empty($ids)) {
+ Message::addError('main.parameter-empty', 'uuid');
+ return;
+ }
+ $this->getAllowedMachines(".vmstore.benchmark", $ids, $allowedMachines);
+ if (empty($allowedMachines))
+ return;
+ VmStoreBenchmark::prepareSelectDialog($allowedMachines);
+ }
+
private function getAllowedMachines($permission, $ids, &$allowedMachines)
{
$allowedLocations = User::getAllowedLocations($permission);