From 8d9be8910e07b28b4510482c0720425f8ed8233e Mon Sep 17 00:00:00 2001 From: Alexander Vladishev Date: Sun, 3 May 2020 17:30:06 +0300 Subject: A.F.I..... [ZBX-17667] moved "frontends/php" to "ui" directory --- .../controllers/CControllerWidgetDataOverView.php | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 ui/app/controllers/CControllerWidgetDataOverView.php (limited to 'ui/app/controllers/CControllerWidgetDataOverView.php') diff --git a/ui/app/controllers/CControllerWidgetDataOverView.php b/ui/app/controllers/CControllerWidgetDataOverView.php new file mode 100644 index 00000000000..bcf3708c6aa --- /dev/null +++ b/ui/app/controllers/CControllerWidgetDataOverView.php @@ -0,0 +1,68 @@ +setType(WIDGET_DATA_OVER); + $this->setValidationRules([ + 'name' => 'string', + 'fields' => 'json', + ]); + } + + protected function doAction() { + $fields = $this->getForm()->getFieldsData(); + + $groupids = $fields['groupids'] ? getSubGroups($fields['groupids']) : null; + $hostids = $fields['hostids'] ? $fields['hostids'] : null; + + if ($fields['style'] == STYLE_TOP) { + list($db_items, $db_hosts, $items_by_name, $has_hidden_data) = getDataOverviewTop($groupids, $hostids, + $fields['application'] + ); + } + else { + list($db_items, $db_hosts, $items_by_name, $has_hidden_data) = getDataOverviewLeft($groupids, $hostids, + $fields['application'] + ); + } + + $visible_items = getDataOverviewCellData($db_hosts, $db_items, $items_by_name, $fields['show_suppressed']); + + $this->setResponse(new CControllerResponseData([ + 'name' => $this->getInput('name', $this->getDefaultHeader()), + 'groupids' => getSubGroups($fields['groupids']), + 'application' => $fields['application'], + 'show_suppressed' => $fields['show_suppressed'], + 'style' => $fields['style'], + 'visible_items' => $visible_items, + 'db_hosts' => $db_hosts, + 'items_by_name' => $items_by_name, + 'has_hidden_data' => $has_hidden_data, + 'user' => [ + 'debug_mode' => $this->getDebugMode() + ] + ])); + } +} -- cgit v1.2.3