[icinga-checkins] icinga.org: icingaweb2-module-director/master: IcingaServiceSetTable: Fix counter to show distinct counted values

git at icinga.org git at icinga.org
Fri Nov 11 15:33:26 CET 2016


Module: icingaweb2-module-director
Branch: master
Commit: ae70de9755e18dbd090382b09baf0aef7c7d5684
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=ae70de9755e18dbd090382b09baf0aef7c7d5684

Author: Markus Frosch <markus.frosch at icinga.com>
Date:   Fri Nov 11 15:17:15 2016 +0100

IcingaServiceSetTable: Fix counter to show distinct counted values

refs #12891

---

 application/tables/IcingaServiceSetTable.php |   14 +++++++-------
 library/Director/Web/Table/QuickTable.php    |    4 ++++
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/application/tables/IcingaServiceSetTable.php b/application/tables/IcingaServiceSetTable.php
index 64dccd5..c3c3a66 100644
--- a/application/tables/IcingaServiceSetTable.php
+++ b/application/tables/IcingaServiceSetTable.php
@@ -13,13 +13,13 @@ class IcingaServiceSetTable extends IcingaObjectTable
     public function getColumns()
     {
         return array(
-            'id'          => 'sset.id',
-            'name'        => 'sset.object_name',
-            'object_type' => 'sset.object_type',
-            'assign_filter' => 'sset.assign_filter',
-            'description' => 'sset.description',
-            'count_hosts' => 'count(ssetobj.id)',
-            'count_services' => 'count(s.id)',
+            'id'             => 'sset.id',
+            'name'           => 'sset.object_name',
+            'object_type'    => 'sset.object_type',
+            'assign_filter'  => 'sset.assign_filter',
+            'description'    => 'sset.description',
+            'count_hosts'    => 'count(distinct ssetobj.id)',
+            'count_services' => 'count(distinct s.id)',
         );
     }
 
diff --git a/library/Director/Web/Table/QuickTable.php b/library/Director/Web/Table/QuickTable.php
index 43cd3f3..d1f9b03 100644
--- a/library/Director/Web/Table/QuickTable.php
+++ b/library/Director/Web/Table/QuickTable.php
@@ -16,6 +16,7 @@ use Icinga\Module\Director\Db;
 use Icinga\Module\Director\PlainObjectRenderer;
 use Icinga\Web\Request;
 use Icinga\Web\Url;
+use Icinga\Web\View;
 use Icinga\Web\Widget;
 use Icinga\Web\Widget\Paginator;
 use stdClass;
@@ -314,6 +315,9 @@ abstract class QuickTable implements Paginatable
         return $htm . "</tbody>\n</table>\n";
     }
 
+    /**
+     * @return View
+     */
     protected function view()
     {
         if ($this->view === null) {



More information about the icinga-checkins mailing list