Merge branch 'master' into bugfix/make-all-views-dashboard-compliant-7876
This commit is contained in:
commit
da7aa23820
|
@ -117,13 +117,18 @@ class Menu implements RecursiveIterator
|
|||
foreach ($props as $key => $value) {
|
||||
$method = 'set' . implode('', array_map('ucfirst', explode('_', strtolower($key))));
|
||||
if ($key === 'renderer') {
|
||||
$class = '\Icinga\Web\Menu\\' . $value;
|
||||
if (!class_exists($class)) {
|
||||
throw new ConfigurationError(
|
||||
sprintf('ItemRenderer with class "%s" does not exist', $class)
|
||||
);
|
||||
$value = '\\' . ltrim($value, '\\');
|
||||
if (class_exists($value)) {
|
||||
$value = new $value;
|
||||
} else {
|
||||
$class = '\Icinga\Web\Menu' . $value;
|
||||
if (!class_exists($class)) {
|
||||
throw new ConfigurationError(
|
||||
sprintf('ItemRenderer with class "%s" does not exist', $class)
|
||||
);
|
||||
}
|
||||
$value = new $class;
|
||||
}
|
||||
$value = new $class;
|
||||
}
|
||||
if (method_exists($this, $method)) {
|
||||
$this->{$method}($value);
|
||||
|
|
|
@ -50,8 +50,7 @@ foreach ($serviceDescriptions as $service_description): ?>
|
|||
'service_description' => $service_description
|
||||
),
|
||||
array(
|
||||
'title' => sprintf($this->translate('List all services with the name "%s" on all reported hosts'), $service_description),
|
||||
'data-tooltip-gravity' => 's'
|
||||
'title' => sprintf($this->translate('List all services with the name "%s" on all reported hosts'), $service_description)
|
||||
),
|
||||
false
|
||||
); ?>
|
||||
|
|
|
@ -94,17 +94,17 @@ $this->provideSearchUrl($this->translate('Servicegroups'), 'monitoring/list/serv
|
|||
* Problems Section
|
||||
*/
|
||||
$section = $this->menuSection($this->translate('Problems'), array(
|
||||
'renderer' => 'ProblemMenuItemRenderer',
|
||||
'renderer' => 'Icinga\Module\Monitoring\Web\Menu\ProblemMenuItemRenderer',
|
||||
'icon' => 'block',
|
||||
'priority' => 20
|
||||
));
|
||||
$section->add($this->translate('Unhandled Hosts'), array(
|
||||
'renderer' => 'UnhandledHostMenuItemRenderer',
|
||||
'renderer' => 'Icinga\Module\Monitoring\Web\Menu\UnhandledHostMenuItemRenderer',
|
||||
'url' => 'monitoring/list/hosts?host_problem=1&host_handled=0',
|
||||
'priority' => 30
|
||||
));
|
||||
$section->add($this->translate('Unhandled Services'), array(
|
||||
'renderer' => 'UnhandledServiceMenuItemRenderer',
|
||||
'renderer' => 'Icinga\Module\Monitoring\Web\Menu\UnhandledServiceMenuItemRenderer',
|
||||
'url' => 'monitoring/list/services?service_problem=1&service_handled=0&sort=service_severity',
|
||||
'priority' => 40
|
||||
));
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
<?php
|
||||
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
||||
|
||||
namespace Icinga\Web\Menu;
|
||||
namespace Icinga\Module\Monitoring\Web\Menu;
|
||||
|
||||
use Icinga\Web\Menu as Menu;
|
||||
use Icinga\Module\Monitoring\Backend\MonitoringBackend;
|
||||
use Icinga\Web\Menu;
|
||||
use Icinga\Web\Menu\MenuItemRenderer;
|
||||
use Icinga\Web\Url;
|
||||
|
||||
class MonitoringMenuItemRenderer implements MenuItemRenderer {
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
||||
|
||||
namespace Icinga\Web\Menu;
|
||||
namespace Icinga\Module\Monitoring\Web\Menu;
|
||||
|
||||
class ProblemMenuItemRenderer extends MonitoringMenuItemRenderer
|
||||
{
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
||||
|
||||
namespace Icinga\Web\Menu;
|
||||
|
||||
use Icinga\Web\Menu;
|
||||
namespace Icinga\Module\Monitoring\Web\Menu;
|
||||
|
||||
class UnhandledHostMenuItemRenderer extends MonitoringMenuItemRenderer
|
||||
{
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
||||
|
||||
namespace Icinga\Web\Menu;
|
||||
|
||||
use Icinga\Web\Menu;
|
||||
namespace Icinga\Module\Monitoring\Web\Menu;
|
||||
|
||||
class UnhandledServiceMenuItemRenderer extends MonitoringMenuItemRenderer
|
||||
{
|
|
@ -31,15 +31,25 @@
|
|||
$('i[title]', el).tipsy({ gravity: $.fn.tipsy.autoNS, offset: 2 });
|
||||
$('[title]', el).each(function (i, el) {
|
||||
var $el = $(el);
|
||||
var delay = 500;
|
||||
var delay, gravity;
|
||||
if ($el.data('tooltip-delay') !== undefined) {
|
||||
delay = $el.data('tooltip-delay');
|
||||
}
|
||||
var gravity = $.fn.tipsy.autoNS;
|
||||
if ($el.data('tooltip-gravity')) {
|
||||
gravity = $el.data('tooltip-gravity');
|
||||
}
|
||||
$el.tipsy({ gravity: gravity, delayIn: delay });
|
||||
if (delay === undefined &&
|
||||
gravity === undefined &&
|
||||
!$el.data('title-rich')) {
|
||||
// use native tooltips for everything that doesn't
|
||||
// require specific behavior or html markup
|
||||
return;
|
||||
}
|
||||
delay = delay === undefined ? 500 : delay;
|
||||
$el.tipsy({
|
||||
gravity: gravity || $.fn.tipsy.autoNS,
|
||||
delayIn: delay
|
||||
});
|
||||
});
|
||||
|
||||
// migrate or remove all orphaned tooltips
|
||||
|
|
Loading…
Reference in New Issue