From ae128c579ba1b06ee740ea5f07919cf4f33f340f Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 6 Jul 2022 15:56:29 +0200 Subject: [statistics] Fix Chart.js for HDD view --- modules-available/statistics/page.inc.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'modules-available/statistics/page.inc.php') 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); -- cgit v1.2.3-55-g7522