setTitle($this->translate('Downtime')); $name = $this->params->shiftRequired('name'); $query = Downtime::on($this->getDb())->with([ 'host', 'host.state', 'service', 'service.state', 'service.host', 'service.host.state' ]); $query->getSelectBase() ->where(['downtime.name = ?' => $name]); $this->applyMonitoringRestriction($query); $downtime = $query->first(); if ($downtime === null) { throw new NotFoundError($this->translate('Downtime not found')); } $this->downtime = $downtime; } public function indexAction() { $detail = new DowntimeDetail($this->downtime); $this->addControl((new DowntimeList([$this->downtime]))->setViewMode('minimal')->setCaptionDisabled()); $this->addContent($detail); $this->setAutorefreshInterval(10); } protected function fetchCommandTargets() { return [$this->downtime]; } protected function getCommandTargetsUrl() { return Links::downtime($this->downtime); } }