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)); + } +}