|
5 | 5 |
|
6 | 6 | namespace Icinga\Module\Icingadb\ProvidedHook\Notifications\V2; |
7 | 7 |
|
| 8 | +use ArrayIterator; |
8 | 9 | use Icinga\Module\Icingadb\Common\Auth; |
9 | 10 | use Icinga\Module\Icingadb\Common\Database; |
10 | 11 | use Icinga\Module\Icingadb\Data\QueryColumnsProvider; |
@@ -37,10 +38,15 @@ class Icinga2Source implements SourceHook |
37 | 38 | public function __construct() |
38 | 39 | { |
39 | 40 | $this->allowedColumns = [ |
| 41 | + 'object.type' => $this->translate('Object Type'), |
40 | 42 | 'host.name' => $this->translate('Host Name'), |
| 43 | + 'host.display_name' => $this->translate('Host Display Name'), |
41 | 44 | 'hostgroup.name' => $this->translate('Hostgroup Name'), |
| 45 | + 'hostgroup.display_name' => $this->translate('Hostgroup Display Name'), |
42 | 46 | 'service.name' => $this->translate('Service Name'), |
43 | | - 'servicegroup.name' => $this->translate('Servicegroup Name') |
| 47 | + 'service.display_name' => $this->translate('Service Display Name'), |
| 48 | + 'servicegroup.name' => $this->translate('Servicegroup Name'), |
| 49 | + 'servicegroup.display_name' => $this->translate('Servicegroup Display Name') |
44 | 50 | ]; |
45 | 51 | } |
46 | 52 |
|
@@ -107,6 +113,13 @@ public function enrichCondition(Condition $condition): void |
107 | 113 |
|
108 | 114 | public function getValueSuggestions(string $column, string $searchTerm, Chain $searchFilter): Traversable |
109 | 115 | { |
| 116 | + if ($column === 'object.type') { |
| 117 | + return new ArrayIterator([ |
| 118 | + ['search' => 'host'], |
| 119 | + ['search' => 'service'] |
| 120 | + ]); |
| 121 | + } |
| 122 | + |
110 | 123 | return new QueryValuesProvider( |
111 | 124 | Host::on($this->getDb())->limit(50), |
112 | 125 | $column, |
|
0 commit comments