monitoring: Prohibit sorting the HostStatus data view by service columns

refs #7344
refs #9009
This commit is contained in:
Eric Lippmann 2015-05-26 13:48:48 +02:00
parent e240f7b955
commit b24e3393f0
1 changed files with 29 additions and 29 deletions

View File

@ -5,6 +5,19 @@ namespace Icinga\Module\Monitoring\DataView;
class HostStatus extends DataView class HostStatus extends DataView
{ {
/**
* {@inheritdoc}
*/
public function isValidFilterTarget($column)
{
if ($column[0] === '_'
&& preg_match('/^_host_/', $column)
) {
return true;
}
return parent::isValidFilterTarget($column);
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
@ -66,6 +79,22 @@ class HostStatus extends DataView
); );
} }
/**
* {@inheritdoc}
*/
public function getFilterColumns()
{
return array('host', 'hostgroup', 'hostgroup_name');
}
/**
* {@inheritdoc}
*/
public function getSearchColumns()
{
return array('host', 'host_display_name');
}
/** /**
* The sort rules for this query * The sort rules for this query
* *
@ -96,33 +125,4 @@ class HostStatus extends DataView
) )
); );
} }
/**
* {@inheritdoc}
*/
public function getFilterColumns()
{
return array('host', 'hostgroup', 'hostgroup_name', 'service', 'servicegroup', 'servicegroup_name');
}
/**
* {@inheritdoc}
*/
public function isValidFilterTarget($column)
{
if ($column[0] === '_'
&& preg_match('/^_(?:host|service)_/', $column)
) {
return true;
}
return parent::isValidFilterTarget($column);
}
/**
* {@inheritdoc}
*/
public function getSearchColumns()
{
return array('host', 'host_display_name');
}
} }