setTitle($this->translate('Service Groups')); $compact = $this->view->compact; $db = $this->getDb(); $servicegroups = ServicegroupSummary::on($db); $limitControl = $this->createLimitControl(); $paginationControl = $this->createPaginationControl($servicegroups); $sortControl = $this->createSortControl( $servicegroups, [ 'display_name' => $this->translate('Name'), 'services_severity desc' => $this->translate('Severity'), 'services_total desc' => $this->translate('Total Services') ] ); $filterControl = $this->createFilterControl($servicegroups); $this->filter($servicegroups); $servicegroups->peekAhead($compact); yield $this->export($servicegroups); $this->addControl($paginationControl); $this->addControl($sortControl); $this->addControl($limitControl); $this->addControl($filterControl); $results = $servicegroups->execute(); $this->addContent( (new ServicegroupList($results))->setBaseFilter($this->getFilter()) ); if ($compact) { $this->addContent( (new ShowMore($results, Url::fromRequest()->without(['view', 'limit']))) ->setAttribute('data-base-target', '_next') ->setAttribute('title', sprintf( $this->translate('Show all %d servicegroups'), $servicegroups->count() )) ); } $this->setAutorefreshInterval(30); } }