mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-06-09 08:42:14 -04:00
Introduce ServicesController
This commit is contained in:
parent
aff95a3537
commit
129aac1fa4
1 changed files with 37 additions and 0 deletions
37
application/controllers/ServicesController.php
Normal file
37
application/controllers/ServicesController.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Module\Eagle\Controllers;
|
||||
|
||||
use Icinga\Module\Eagle\Model\Service;
|
||||
use Icinga\Module\Eagle\Web\Controller;
|
||||
use Icinga\Module\Eagle\Widget\ServiceList;
|
||||
|
||||
class ServicesController extends Controller
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$this->setTitle($this->translate('Services'));
|
||||
|
||||
$db = $this->getDb();
|
||||
|
||||
$services = Service::on($db)->with([
|
||||
'state',
|
||||
'host'
|
||||
]);
|
||||
|
||||
$viewModeSwitcher = $this->createViewModeSwitcher();
|
||||
$limitControl = $this->createLimitControl();
|
||||
|
||||
$services->limit($limitControl->getLimit());
|
||||
|
||||
$serviceList = (new ServiceList($services))
|
||||
->setRedis($this->getRedis())
|
||||
->setViewMode($viewModeSwitcher->getViewMode());
|
||||
|
||||
$this->addControl($this->createPaginationControl($services));
|
||||
$this->addControl($viewModeSwitcher);
|
||||
$this->addControl($limitControl);
|
||||
|
||||
$this->addContent($serviceList);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue