mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-06-08 16:22:05 -04:00
Add limit control to host list
This commit is contained in:
parent
af38b15ccf
commit
a6d65bb375
1 changed files with 6 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Icinga\Module\Eagle\Controllers;
|
||||
|
||||
use GuzzleHttp\Psr7\ServerRequest;
|
||||
use Icinga\Module\Eagle\Model\Host;
|
||||
use Icinga\Module\Eagle\Web\Controller;
|
||||
use Icinga\Module\Eagle\Widget\HostList;
|
||||
|
|
@ -15,15 +16,19 @@ class HostsController extends Controller
|
|||
$db = $this->getDb();
|
||||
|
||||
$hosts = Host::on($db)->with('state');
|
||||
$hosts->limit(25);
|
||||
// @TODO(el): Looks a bit odd since createLimitControl() also shifts the limit
|
||||
$hosts->limit($this->params->shift('limit'));
|
||||
|
||||
$viewModeSwitcher = $this->createViewModeSwitcher();
|
||||
$limitControl = $this->createLimitControl();
|
||||
$limitControl->handleRequest(ServerRequest::fromGlobals());
|
||||
|
||||
$hostList = (new HostList($hosts))
|
||||
->setRedis($this->getRedis())
|
||||
->setViewMode($viewModeSwitcher->getViewMode());
|
||||
|
||||
$this->addControl($viewModeSwitcher);
|
||||
$this->addControl($limitControl);
|
||||
|
||||
$this->addContent($hostList);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue