From d34794103d79fb79c751f7504287e7ef5ec46a8d Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 5 Nov 2019 11:52:57 +0100 Subject: [PATCH] Introduce HistoryController --- application/controllers/HistoryController.php | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 application/controllers/HistoryController.php diff --git a/application/controllers/HistoryController.php b/application/controllers/HistoryController.php new file mode 100644 index 00000000..27790770 --- /dev/null +++ b/application/controllers/HistoryController.php @@ -0,0 +1,46 @@ +setTitle($this->translate('History')); + + $db = $this->getDb(); + + $history = History::on($db)->with([ + 'host', + 'host.state', + 'service', + 'service.state', + 'service.host', + 'service.host.state', + 'comment', + 'downtime', + 'notification', + 'state' + ]); + + $history->getSelectBase()->orderBy('event_time DESC'); + + $limitControl = $this->createLimitControl(); + $paginationControl = $this->createPaginationControl($history); + $filterControl = $this->createFilterControl($history); + + $this->filter($history); + + yield $this->export($history); + + $this->addControl($paginationControl); + $this->addControl($limitControl); + $this->addControl($filterControl); + + $this->addContent(new HistoryList($history)); + } +}