mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-03-18 00:25:59 -04:00
38 lines
1 KiB
PHP
38 lines
1 KiB
PHP
<?php
|
|
|
|
namespace Icinga\Module\Icingadb\Controllers;
|
|
|
|
use Icinga\Module\Icingadb\Model\Host;
|
|
use Icinga\Module\Icingadb\Web\Controller;
|
|
use Icinga\Module\Icingadb\Widget\HostList;
|
|
|
|
class HostsController extends Controller
|
|
{
|
|
public function indexAction()
|
|
{
|
|
$this->setTitle($this->translate('Hosts'));
|
|
|
|
$db = $this->getDb();
|
|
|
|
$hosts = Host::on($db)->with('state');
|
|
|
|
$limitControl = $this->createLimitControl();
|
|
$paginationControl = $this->createPaginationControl($hosts);
|
|
$viewModeSwitcher = $this->createViewModeSwitcher();
|
|
$filterControl = $this->createFilterControl($hosts);
|
|
|
|
$hostList = (new HostList($hosts))
|
|
->setViewMode($viewModeSwitcher->getViewMode());
|
|
|
|
$this->filter($hosts);
|
|
|
|
yield $this->export($hosts);
|
|
|
|
$this->addControl($paginationControl);
|
|
$this->addControl($viewModeSwitcher);
|
|
$this->addControl($limitControl);
|
|
$this->addControl($filterControl);
|
|
|
|
$this->addContent($hostList);
|
|
}
|
|
}
|