From fc3aaf67340c25b5e8ec70a5f32c2ec52c86dc90 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Wed, 11 Dec 2019 13:54:11 +0100 Subject: [PATCH] Hostgroups: Add sort control --- application/controllers/HostgroupsController.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/application/controllers/HostgroupsController.php b/application/controllers/HostgroupsController.php index b40f07c9..1f92901e 100644 --- a/application/controllers/HostgroupsController.php +++ b/application/controllers/HostgroupsController.php @@ -18,6 +18,15 @@ class HostgroupsController extends Controller $limitControl = $this->createLimitControl(); $paginationControl = $this->createPaginationControl($hostgroups); + $sortControl = $this->createSortControl( + $hostgroups, + [ + 'display_name' => $this->translate('Name'), + 'hosts_severity desc' => $this->translate('Severity'), + 'hosts_total desc' => $this->translate('Total Hosts'), + 'services_total desc' => $this->translate('Total Services') + ] + ); $filterControl = $this->createFilterControl($hostgroups); $this->filter($hostgroups); @@ -25,6 +34,7 @@ class HostgroupsController extends Controller yield $this->export($hostgroups); $this->addControl($paginationControl); + $this->addControl($sortControl); $this->addControl($limitControl); $this->addControl($filterControl);