monitoring: Prohibit sorting the HostStatus data view by service columns
refs #7344 refs #9009
This commit is contained in:
parent
e240f7b955
commit
b24e3393f0
|
@ -5,6 +5,19 @@ namespace Icinga\Module\Monitoring\DataView;
|
|||
|
||||
class HostStatus extends DataView
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isValidFilterTarget($column)
|
||||
{
|
||||
if ($column[0] === '_'
|
||||
&& preg_match('/^_host_/', $column)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return parent::isValidFilterTarget($column);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@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
|
||||
*
|
||||
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue