IcingaServiceSetTable: Fix counter to show distinct counted values

refs #12891
This commit is contained in:
Markus Frosch 2016-11-11 15:17:15 +01:00
parent 01ef8cb4ba
commit ae70de9755
2 changed files with 11 additions and 7 deletions

View File

@ -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)',
);
}

View File

@ -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) {