2013-09-26 11:02:56 -04:00
|
|
|
<?php
|
2015-02-04 04:46:36 -05:00
|
|
|
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
2013-09-26 11:02:56 -04:00
|
|
|
|
|
|
|
|
namespace Icinga\Module\Monitoring\DataView;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* View representation for comments
|
|
|
|
|
*/
|
|
|
|
|
class Comment extends DataView
|
|
|
|
|
{
|
|
|
|
|
/**
|
2015-03-11 05:43:19 -04:00
|
|
|
* {@inheritdoc}
|
2013-09-26 11:02:56 -04:00
|
|
|
*/
|
|
|
|
|
public function getColumns()
|
|
|
|
|
{
|
|
|
|
|
return array(
|
2014-03-09 14:29:23 -04:00
|
|
|
'comment_objecttype',
|
|
|
|
|
'comment_internal_id',
|
2013-09-26 11:02:56 -04:00
|
|
|
'comment_data',
|
2015-04-09 07:06:38 -04:00
|
|
|
'comment_author_name',
|
2013-09-26 11:02:56 -04:00
|
|
|
'comment_timestamp',
|
|
|
|
|
'comment_type',
|
|
|
|
|
'comment_is_persistent',
|
2014-03-09 15:05:59 -04:00
|
|
|
'comment_expiration',
|
2015-04-09 06:49:06 -04:00
|
|
|
'host_name',
|
|
|
|
|
'service_description',
|
2015-01-21 10:09:36 -05:00
|
|
|
'host_display_name',
|
2015-04-09 06:56:31 -04:00
|
|
|
'service_display_name',
|
|
|
|
|
'service_host_name'
|
2013-09-26 11:02:56 -04:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2015-03-11 05:43:19 -04:00
|
|
|
* {@inheritdoc}
|
2013-09-26 11:02:56 -04:00
|
|
|
*/
|
|
|
|
|
public function getSortRules()
|
|
|
|
|
{
|
|
|
|
|
return array(
|
|
|
|
|
'comment_timestamp' => array(
|
2014-03-09 14:29:23 -04:00
|
|
|
'order' => self::SORT_DESC
|
2013-09-26 11:02:56 -04:00
|
|
|
),
|
2015-01-21 10:15:09 -05:00
|
|
|
'host_display_name' => array(
|
2014-03-09 14:29:23 -04:00
|
|
|
'columns' => array(
|
2015-01-21 10:15:09 -05:00
|
|
|
'host_display_name',
|
|
|
|
|
'service_display_name'
|
2013-09-26 11:02:56 -04:00
|
|
|
),
|
2014-03-09 14:29:23 -04:00
|
|
|
'order' => self::SORT_ASC
|
2013-09-26 11:02:56 -04:00
|
|
|
),
|
2015-01-21 10:15:09 -05:00
|
|
|
'service_display_name' => array(
|
|
|
|
|
'columns' => array(
|
|
|
|
|
'service_display_name',
|
|
|
|
|
'host_display_name'
|
|
|
|
|
),
|
|
|
|
|
'order' => self::SORT_ASC
|
|
|
|
|
)
|
2013-09-26 11:02:56 -04:00
|
|
|
);
|
|
|
|
|
}
|
2015-04-09 06:53:28 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* {@inheritdoc}
|
|
|
|
|
*/
|
|
|
|
|
public function getFilterColumns()
|
|
|
|
|
{
|
2015-04-09 07:08:49 -04:00
|
|
|
return array('comment_author', 'host', 'service', 'service_host');
|
2015-04-09 06:53:28 -04:00
|
|
|
}
|
2013-09-26 11:02:56 -04:00
|
|
|
}
|