mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-02-03 20:40:15 -05:00
42 lines
1.1 KiB
PHP
42 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Icinga\Module\Icingadb\Controllers;
|
|
|
|
use Icinga\Module\Icingadb\Model\Comment;
|
|
use Icinga\Module\Icingadb\Web\Controller;
|
|
use Icinga\Module\Icingadb\Widget\ItemList\CommentList;
|
|
|
|
class CommentsController extends Controller
|
|
{
|
|
public function indexAction()
|
|
{
|
|
$this->setTitle($this->translate('Comments'));
|
|
|
|
$db = $this->getDb();
|
|
|
|
$comments = Comment::on($db)->with([
|
|
'host',
|
|
'host.state',
|
|
'service',
|
|
'service.host',
|
|
'service.host.state',
|
|
'service.state'
|
|
]);
|
|
|
|
$limitControl = $this->createLimitControl();
|
|
$paginationControl = $this->createPaginationControl($comments);
|
|
$filterControl = $this->createFilterControl($comments);
|
|
|
|
$this->filter($comments);
|
|
|
|
yield $this->export($comments);
|
|
|
|
$this->addControl($paginationControl);
|
|
$this->addControl($limitControl);
|
|
$this->addControl($filterControl);
|
|
|
|
$this->addContent(new CommentList($comments));
|
|
|
|
$this->setAutorefreshInterval(10);
|
|
}
|
|
}
|