addTitleTab(t('Downtime')); $name = $this->params->getRequired('name'); $query = Downtime::on($this->getDb())->with([ 'host', 'host.state', 'service', 'service.state', 'service.host', 'service.host.state', 'parent', 'parent.host', 'parent.host.state', 'parent.service', 'parent.service.state', 'triggered_by', 'triggered_by.host', 'triggered_by.host.state', 'triggered_by.service', 'triggered_by.service.state' ]); $query->filter(Filter::equal('downtime.name', $name)); $this->applyRestrictions($query); $downtime = $query->first(); if ($downtime === null) { throw new NotFoundError(t('Downtime not found')); } $this->downtime = $downtime; } public function indexAction() { $detail = new DowntimeDetail($this->downtime); $this->addControl((new DowntimeList([$this->downtime])) ->setViewMode('minimal') ->setDetailActionsDisabled() ->setCaptionDisabled() ->setNoSubjectLink()); $this->addContent($detail); $this->setAutorefreshInterval(10); } protected function fetchCommandTargets(): array { return [$this->downtime]; } protected function getCommandTargetsUrl(): Url { return Links::downtime($this->downtime); } }