blob: c41d846754dab2674b0302c2dc51de06a4ad9e1f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
<?php
// Icinga Web 2 Cube Module | (c) 2019 Icinga GmbH | GPLv2
namespace Icinga\Module\Cube\Controllers;
use Icinga\Module\Cube\IcingaDb\IcingaDbCube;
use Icinga\Module\Cube\IcingaDb\IcingaDbHostStatusCube;
use Icinga\Module\Cube\Web\Controller;
use Icinga\Module\Icingadb\Model\Host;
use Icinga\Module\Icingadb\Web\Control\SearchBar\ObjectSuggestions;
class HostsController extends Controller
{
public function indexAction(): void
{
$this->createTabs()->activate('cube/hosts');
$this->renderCube();
}
protected function getCube(): IcingaDbCube
{
return new IcingaDbHostStatusCube();
}
public function completeAction(): void
{
$suggestions = new ObjectSuggestions();
$suggestions->setModel(Host::class);
$suggestions->forRequest($this->getServerRequest());
$this->getDocument()->add($suggestions);
}
public function searchEditorAction(): void
{
$editor = $this->createSearchEditor(
Host::on($this->getDb()),
$this->preserveParams
);
$this->getDocument()->add($editor);
$this->setTitle($this->translate('Adjust Filter'));
}
}
|