monitoring: Fix downtime filter columns

refs #9009
refs #9319
This commit is contained in:
Eric Lippmann 2015-05-26 17:10:23 +02:00
parent cd1ee3e306
commit 61565543ab
1 changed files with 25 additions and 8 deletions

View File

@ -6,9 +6,20 @@ namespace Icinga\Module\Monitoring\DataView;
class Downtime extends DataView
{
/**
* Retrieve columns provided by this view
*
* @return array
* {@inheritdoc}
*/
public function isValidFilterTarget($column)
{
if ($column[0] === '_'
&& preg_match('/^_(?:host|service)_/', $column)
) {
return true;
}
return parent::isValidFilterTarget($column);
}
/**
* {@inheritdoc}
*/
public function getColumns()
{
@ -37,6 +48,17 @@ class Downtime extends DataView
);
}
/**
* {@inheritdoc}
*/
public function getFilterColumns()
{
return array('hostgroup', 'hostgroup_alias', 'hostgroup_name', 'servicegroup', 'servicegroup_alias', 'servicegroup_name');
}
/**
* {@inheritdoc}
*/
public function getSortRules()
{
return array(
@ -66,9 +88,4 @@ class Downtime extends DataView
)
);
}
public function getFilterColumns()
{
return array('author', 'host', 'service', 'service_host');
}
}