monitoring: Add missing restrictable columns to host and service comments and downtimes

refs #9009
This commit is contained in:
Eric Lippmann 2015-06-05 14:43:38 +02:00
parent 80c80436cf
commit d830480655
4 changed files with 68 additions and 60 deletions

View File

@ -8,19 +8,6 @@ namespace Icinga\Module\Monitoring\DataView;
*/
class Hostcomment extends DataView
{
/**
* {@inheritdoc}
*/
public function isValidFilterTarget($column)
{
if ($column[0] === '_'
&& preg_match('/^_(?:host|service)_/', $column)
) {
return true;
}
return parent::isValidFilterTarget($column);
}
/**
* {@inheritdoc}
*/
@ -47,8 +34,23 @@ class Hostcomment extends DataView
public function getFilterColumns()
{
return array(
'host', 'hostgroup', 'hostgroup_alias', 'hostgroup_name',
'service', 'servicegroup', 'servicegroup_alias', 'servicegroup_name'
'host', 'host_alias',
'hostgroup', 'hostgroup_alias', 'hostgroup_name',
'service', 'service_description', 'service_display_name',
'servicegroup', 'servicegroup_alias', 'servicegroup_name'
);
}
/**
* {@inheritdoc}
*/
public function isValidFilterTarget($column)
{
if ($column[0] === '_'
&& preg_match('/^_(?:host|service)_/', $column)
) {
return true;
}
return parent::isValidFilterTarget($column);
}
}

View File

@ -8,19 +8,6 @@ namespace Icinga\Module\Monitoring\DataView;
*/
class Hostdowntime extends DataView
{
/**
* {@inheritdoc}
*/
public function isValidFilterTarget($column)
{
if ($column[0] === '_'
&& preg_match('/^_(?:host|service)_/', $column)
) {
return true;
}
return parent::isValidFilterTarget($column);
}
/**
* {@inheritdoc}
*/
@ -52,8 +39,23 @@ class Hostdowntime extends DataView
public function getFilterColumns()
{
return array(
'host', 'hostgroup', 'hostgroup_alias', 'hostgroup_name',
'service', 'servicegroup', 'servicegroup_alias', 'servicegroup_name'
'host', 'host_alias',
'hostgroup', 'hostgroup_alias', 'hostgroup_name',
'service', 'service_description', 'service_display_name',
'servicegroup', 'servicegroup_alias', 'servicegroup_name'
);
}
/**
* {@inheritdoc}
*/
public function isValidFilterTarget($column)
{
if ($column[0] === '_'
&& preg_match('/^_(?:host|service)_/', $column)
) {
return true;
}
return parent::isValidFilterTarget($column);
}
}

View File

@ -8,19 +8,6 @@ namespace Icinga\Module\Monitoring\DataView;
*/
class Servicecomment extends DataView
{
/**
* {@inheritdoc}
*/
public function isValidFilterTarget($column)
{
if ($column[0] === '_'
&& preg_match('/^_(?:host|service)_/', $column)
) {
return true;
}
return parent::isValidFilterTarget($column);
}
/**
* {@inheritdoc}
*/
@ -50,8 +37,23 @@ class Servicecomment extends DataView
public function getFilterColumns()
{
return array(
'host', 'hostgroup', 'hostgroup_alias', 'hostgroup_name',
'service', 'servicegroup', 'servicegroup_alias', 'servicegroup_name'
'host', 'host_alias',
'hostgroup', 'hostgroup_alias', 'hostgroup_name',
'service',
'servicegroup', 'servicegroup_alias', 'servicegroup_name'
);
}
/**
* {@inheritdoc}
*/
public function isValidFilterTarget($column)
{
if ($column[0] === '_'
&& preg_match('/^_(?:host|service)_/', $column)
) {
return true;
}
return parent::isValidFilterTarget($column);
}
}

View File

@ -5,19 +5,6 @@ namespace Icinga\Module\Monitoring\DataView;
class Servicedowntime extends DataView
{
/**
* {@inheritdoc}
*/
public function isValidFilterTarget($column)
{
if ($column[0] === '_'
&& preg_match('/^_(?:host|service)_/', $column)
) {
return true;
}
return parent::isValidFilterTarget($column);
}
/**
* {@inheritdoc}
*/
@ -52,8 +39,23 @@ class Servicedowntime extends DataView
public function getFilterColumns()
{
return array(
'host', 'hostgroup', 'hostgroup_alias', 'hostgroup_name',
'service', 'servicegroup', 'servicegroup_alias', 'servicegroup_name'
'host', 'host_alias',
'hostgroup', 'hostgroup_alias', 'hostgroup_name',
'service',
'servicegroup', 'servicegroup_alias', 'servicegroup_name'
);
}
/**
* {@inheritdoc}
*/
public function isValidFilterTarget($column)
{
if ($column[0] === '_'
&& preg_match('/^_(?:host|service)_/', $column)
) {
return true;
}
return parent::isValidFilterTarget($column);
}
}