diff options
Diffstat (limited to 'modules-available/statistics/page.inc.php')
-rw-r--r-- | modules-available/statistics/page.inc.php | 21 |
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); |