From f00a79a6a75cb905884a07bf6a94e3d5fef1565f Mon Sep 17 00:00:00 2001 From: Andrejs Verza Date: Thu, 24 Sep 2020 14:51:42 +0300 Subject: ..F....... [ZBXNEXT-6001] implemented host dashboard view --- ui/app/controllers/CControllerHost.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ui/app/controllers/CControllerHost.php') diff --git a/ui/app/controllers/CControllerHost.php b/ui/app/controllers/CControllerHost.php index 1d0ce50282c..2d997030e8b 100644 --- a/ui/app/controllers/CControllerHost.php +++ b/ui/app/controllers/CControllerHost.php @@ -51,6 +51,7 @@ abstract class CControllerHost extends CController { // Multiselect host groups. $multiselect_hostgroup_data = []; + if ($filter['groupids']) { $groups = API::HostGroup()->get([ 'output' => ['groupid', 'name'], @@ -129,7 +130,6 @@ abstract class CControllerHost extends CController { ], 'selectInterfaces' => ['ip', 'dns', 'port', 'main', 'type', 'useip'], 'selectGraphs' => API_OUTPUT_COUNT, - 'selectScreens' => API_OUTPUT_COUNT, 'selectHttpTests' => API_OUTPUT_COUNT, 'selectTags' => ['tag', 'value'], 'selectInheritedTags' => ['tag', 'value'], @@ -168,6 +168,9 @@ abstract class CControllerHost extends CController { } foreach ($hosts as &$host) { + // Count number of dashboards for each host. + $host['dashboards'] = count(getHostDashboards($host['hostid'])); + CArrayHelper::sort($host['interfaces'], [['field' => 'main', 'order' => ZBX_SORT_DOWN]]); if ($host['status'] == HOST_STATUS_MONITORED && $host['maintenance_status'] == HOST_MAINTENANCE_STATUS_ON) { -- cgit v1.2.3