mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-06-03 22:05:03 -04:00
Introduce DowntimesController
This commit is contained in:
parent
5322b9acb9
commit
f97d321669
1 changed files with 40 additions and 0 deletions
40
application/controllers/DowntimesController.php
Normal file
40
application/controllers/DowntimesController.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Module\Eagle\Controllers;
|
||||
|
||||
use Icinga\Module\Eagle\Model\Downtime;
|
||||
use Icinga\Module\Eagle\Web\Controller;
|
||||
use Icinga\Module\Eagle\Widget\DowntimeList;
|
||||
|
||||
class DowntimesController extends Controller
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$this->setTitle($this->translate('Downtimes'));
|
||||
|
||||
$db = $this->getDb();
|
||||
|
||||
$downtimes = Downtime::on($db)->with([
|
||||
'host',
|
||||
'host.state',
|
||||
'service',
|
||||
'service.host',
|
||||
'service.host.state',
|
||||
'service.state'
|
||||
]);
|
||||
|
||||
$limitControl = $this->createLimitControl();
|
||||
$paginationControl = $this->createPaginationControl($downtimes);
|
||||
$filterControl = $this->createFilterControl($downtimes);
|
||||
|
||||
$this->filter($downtimes);
|
||||
|
||||
yield $this->export($downtimes);
|
||||
|
||||
$this->addControl($paginationControl);
|
||||
$this->addControl($limitControl);
|
||||
$this->addControl($filterControl);
|
||||
|
||||
$this->addContent(new DowntimeList($downtimes));
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue