[icinga-checkins] icinga.org: icingaweb2/feature/security-gui-5647: Add sort control to the hostgroup- and servicegroupsummary view

git at icinga.org git at icinga.org
Thu Nov 20 16:12:59 CET 2014


Module: icingaweb2
Branch: feature/security-gui-5647
Commit: 4e87d21726a567238fb77305b179ce7ff8aac6fe
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=4e87d21726a567238fb77305b179ce7ff8aac6fe

Author: Johannes Meyer <johannes.meyer at netways.de>
Date:   Thu Nov 20 10:07:46 2014 +0100

Add sort control to the hostgroup- and servicegroupsummary view

---

 .../application/controllers/ListController.php       |   18 ++++++++++++++++--
 .../application/views/scripts/list/hostgroups.phtml  |    3 +++
 .../views/scripts/list/servicegroups.phtml           |    3 +++
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php
index 35f86fe..9ccc91b 100644
--- a/modules/monitoring/application/controllers/ListController.php
+++ b/modules/monitoring/application/controllers/ListController.php
@@ -505,7 +505,14 @@ class Monitoring_ListController extends Controller
         $this->filterQuery($query);
         $this->view->servicegroups = $query->paginate();
         $this->setupSortControl(array(
-            'servicegroup_name' => $this->translate('Servicegroup Name')
+            'services_highest_severity' => $this->translate('Highest Severity'),
+            'servicegroup'              => $this->translate('Service Group Name'),
+            'services_total'            => $this->translate('Total Services'),
+            'services_ok'               => $this->translate('Services OK'),
+            'services_unknown'          => $this->translate('Services UNKNOWN'),
+            'services_critical'         => $this->translate('Services CRITICAL'),
+            'services_warning'          => $this->translate('Services WARNING'),
+            'services_pending'          => $this->translate('Services PENDING')
         ));
     }
 
@@ -545,7 +552,14 @@ class Monitoring_ListController extends Controller
         $this->filterQuery($query);
         $this->view->hostgroups = $query->paginate();
         $this->setupSortControl(array(
-            'hostgroup_name' => $this->translate('Hostgroup Name')
+            'services_highest_severity' => $this->translate('Highest Severity'),
+            'hostgroup'                 => $this->translate('Host Group Name'),
+            'services_total'            => $this->translate('Total Services'),
+            'services_ok'               => $this->translate('Services OK'),
+            'services_unknown'          => $this->translate('Services UNKNOWN'),
+            'services_critical'         => $this->translate('Services CRITICAL'),
+            'services_warning'          => $this->translate('Services WARNING'),
+            'services_pending'          => $this->translate('Services PENDING')
         ));
     }
 
diff --git a/modules/monitoring/application/views/scripts/list/hostgroups.phtml b/modules/monitoring/application/views/scripts/list/hostgroups.phtml
index 0a78613..246de7f 100644
--- a/modules/monitoring/application/views/scripts/list/hostgroups.phtml
+++ b/modules/monitoring/application/views/scripts/list/hostgroups.phtml
@@ -3,6 +3,9 @@
 <?php else: ?>
 <div class="controls">
   <?= $this->tabs ?>
+  <div style="margin: 1em;" class="dontprint">
+    <?= $this->translate('Sort by'); ?> <?= $this->sortControl->render($this); ?>
+  </div>
   <?= $this->widget('limiter')->setMaxLimit(count($hostgroups)); ?>
   <?= $this->paginationControl($hostgroups, null, null, array('preserve' => $this->preserve)); ?>
 </div>
diff --git a/modules/monitoring/application/views/scripts/list/servicegroups.phtml b/modules/monitoring/application/views/scripts/list/servicegroups.phtml
index 50f6801..02bb005 100644
--- a/modules/monitoring/application/views/scripts/list/servicegroups.phtml
+++ b/modules/monitoring/application/views/scripts/list/servicegroups.phtml
@@ -3,6 +3,9 @@
 <?php else: ?>
 <div class="controls">
   <?= $this->tabs ?>
+  <div style="margin: 1em;" class="dontprint">
+    <?= $this->translate('Sort by'); ?> <?= $this->sortControl->render($this); ?>
+  </div>
   <?= $this->widget('limiter')->setMaxLimit(count($servicegroups)); ?>
   <?= $this->paginationControl($servicegroups, null, null, array('preserve' => $this->preserve)); ?>
 </div>



More information about the icinga-checkins mailing list