icingadb-web/application/controllers/ServicegroupsController.php

38 lines
1 KiB
PHP
Raw Normal View History

2019-11-01 18:10:34 -04:00
<?php
2019-11-04 19:07:30 -05:00
namespace Icinga\Module\Icingadb\Controllers;
2019-11-01 18:10:34 -04:00
2019-11-05 03:22:58 -05:00
use Icinga\Module\Icingadb\Model\ServicegroupSummary;
2019-11-04 19:07:30 -05:00
use Icinga\Module\Icingadb\Web\Controller;
use Icinga\Module\Icingadb\Widget\ItemList\ServicegroupList;
2019-11-01 18:10:34 -04:00
class ServicegroupsController extends Controller
{
public function indexAction() {
$this->setTitle($this->translate('Service Groups'));
$db = $this->getDb();
2019-11-05 03:22:58 -05:00
$servicegroups = ServicegroupSummary::on($db);
2019-11-01 18:10:34 -04:00
$limitControl = $this->createLimitControl();
$paginationControl = $this->createPaginationControl($servicegroups);
$filterControl = $this->createFilterControl($servicegroups);
$this->filter($servicegroups);
yield $this->export($servicegroups);
$this->addControl($paginationControl);
$this->addControl($limitControl);
$this->addControl($filterControl);
$this->addContent(
(new ServicegroupList($servicegroups))->setBaseFilter($this->getFilter())
);
$this->setAutorefreshInterval(30);
2019-11-01 18:10:34 -04:00
}
}