hasPermission('eventdb/events')) {
return '';
}
$config = static::config();
if ($config->get('detailview_disable') === '1') {
return '';
}
$actions = clone EventdbActionHook::getActions($object);
if (! $actions->hasRenderableItems()) {
// no actions -> no EventDB
return '';
}
$htm = '
EventDB
';
$htm .= '';
$actions->setLayout(Navigation::LAYOUT_TABS);
$htm .= $actions->render();
$htm .= '
';
$url = Url::fromPath('eventdb/events', array('host_name' => $object->host_name));
$customFilter = EventdbActionHook::getCustomFilter($object);
if ($customFilter === null) {
$customFilter = new FilterAnd;
}
$detailview_filter = $config->get('detailview_filter', 'ack=0');
if ($detailview_filter !== null) {
$customFilter = $customFilter->andFilter(Filter::fromQueryString($detailview_filter));
}
$htm .= sprintf(
'',
$url->with(array(
'sort' => 'priority',
'dir' => 'asc',
'view' => 'compact',
'limit' => 5,
))->addFilter($customFilter)
);
$htm .= '
' . mt('eventdb', 'Loading') . '...
';
$htm .= '
';
return $htm;
}
protected function eventDb()
{
return Eventdb::fromConfig();
}
protected static function config()
{
return Config::module('eventdb')->getSection('monitoring');
}
}