mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 16:24:04 +02:00
monitoring: Add restrictable filter columns to the comment data view
refs #9009
This commit is contained in:
parent
41bc4e3b21
commit
54eb0eaf22
@ -4,32 +4,57 @@
|
||||
namespace Icinga\Module\Monitoring\DataView;
|
||||
|
||||
/**
|
||||
* View representation for comments
|
||||
* Host and service comments view
|
||||
*/
|
||||
class Comment extends DataView
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isValidFilterTarget($column)
|
||||
{
|
||||
if ($column[0] === '_'
|
||||
&& preg_match('/^_(?:host|service)_/', $column)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return parent::isValidFilterTarget($column);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getColumns()
|
||||
{
|
||||
return array(
|
||||
'comment_objecttype',
|
||||
'comment_internal_id',
|
||||
'comment_data',
|
||||
'comment_author_name',
|
||||
'comment_data',
|
||||
'comment_expiration',
|
||||
'comment_internal_id',
|
||||
'comment_is_persistent',
|
||||
'comment_timestamp',
|
||||
'comment_type',
|
||||
'comment_is_persistent',
|
||||
'comment_expiration',
|
||||
'host_name',
|
||||
'service_description',
|
||||
'host_display_name',
|
||||
'host_name',
|
||||
'object_type',
|
||||
'service_description',
|
||||
'service_display_name',
|
||||
'service_host_name'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getFilterColumns()
|
||||
{
|
||||
return array(
|
||||
'comment_author ',
|
||||
'host', 'hostgroup', 'hostgroup_alias', 'hostgroup_name',
|
||||
'service', 'servicegroup', 'servicegroup_alias', 'servicegroup_name'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@ -55,12 +80,4 @@ class Comment extends DataView
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getFilterColumns()
|
||||
{
|
||||
return array('comment_author', 'host', 'service', 'service_host');
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user