From f97d32166971a9cfe1b90cdbf351d431a79ef145 Mon Sep 17 00:00:00 2001 From: Marius Hein Date: Thu, 17 Oct 2019 10:16:08 +0200 Subject: [PATCH] Introduce DowntimesController --- .../controllers/DowntimesController.php | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 application/controllers/DowntimesController.php diff --git a/application/controllers/DowntimesController.php b/application/controllers/DowntimesController.php new file mode 100644 index 00000000..1c7f81d1 --- /dev/null +++ b/application/controllers/DowntimesController.php @@ -0,0 +1,40 @@ +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)); + } +}