setTitle($this->translate('Comment')); $name = $this->params->shiftRequired('name'); $query = Comment::on($this->getDb()) ->with('host') ->with('host.state'); $query->getSelectBase() ->where(['comment.name = ?' => $name]); $this->applyMonitoringRestriction($query); $comment = $query->first(); if ($comment === null) { throw new NotFoundError($this->translate('Comment not found')); } $this->comment = $comment; } protected function fetchCommandTargets() { return [$this->comment]; } protected function getCommandTargetsUrl() { return Links::comment($this->comment); } public function indexAction() { $detail = new CommentDetail($this->comment); $this->addControl($detail->getControl()); $this->addContent($detail); $this->setAutorefreshInterval(10); } }