diff --git a/modules/monitoring/application/views/helpers/Customvar.php b/modules/monitoring/application/views/helpers/Customvar.php index 168c18b38..8bfdc3a52 100644 --- a/modules/monitoring/application/views/helpers/Customvar.php +++ b/modules/monitoring/application/views/helpers/Customvar.php @@ -34,9 +34,11 @@ class Zend_View_Helper_Customvar extends Zend_View_Helper_Abstract return '[]'; } $out = "\n"; } @@ -46,6 +48,7 @@ class Zend_View_Helper_Customvar extends Zend_View_Helper_Abstract return '{}'; } $out = "{}"; } } diff --git a/modules/monitoring/application/views/helpers/Perfdata.php b/modules/monitoring/application/views/helpers/Perfdata.php index 6b9113830..e7bc72b38 100644 --- a/modules/monitoring/application/views/helpers/Perfdata.php +++ b/modules/monitoring/application/views/helpers/Perfdata.php @@ -108,7 +108,7 @@ class Zend_View_Helper_Perfdata extends Zend_View_Helper_Abstract return ''; } return sprintf( - '%s
', + '%s
', implode("\n", $table) ); } diff --git a/modules/monitoring/application/views/scripts/partials/object/detail-content.phtml b/modules/monitoring/application/views/scripts/partials/object/detail-content.phtml index dbd8abc21..3ab6dab17 100644 --- a/modules/monitoring/application/views/scripts/partials/object/detail-content.phtml +++ b/modules/monitoring/application/views/scripts/partials/object/detail-content.phtml @@ -43,7 +43,7 @@ customvars)): ?>

translate('Custom Variables') ?>

- +
render('show/components/customvars.phtml') ?> diff --git a/modules/monitoring/application/views/scripts/show/components/notes.phtml b/modules/monitoring/application/views/scripts/show/components/notes.phtml index 87907cfb4..c868c955f 100644 --- a/modules/monitoring/application/views/scripts/show/components/notes.phtml +++ b/modules/monitoring/application/views/scripts/show/components/notes.phtml @@ -38,7 +38,11 @@ if (($navigation->isEmpty() || ! $navigation->hasRenderableItems()) && $notes == \ No newline at end of file diff --git a/modules/monitoring/application/views/scripts/show/components/output.phtml b/modules/monitoring/application/views/scripts/show/components/output.phtml index c450319a1..34d82689b 100644 --- a/modules/monitoring/application/views/scripts/show/components/output.phtml +++ b/modules/monitoring/application/views/scripts/show/components/output.phtml @@ -1,3 +1,5 @@

translate('Plugin Output') ?>

-pluginOutput($object->output, false, $object->check_command) ?> -pluginOutput($object->long_output, false, $object->check_command) ?> +
+ pluginOutput($object->output, false, $object->check_command) ?> + pluginOutput($object->long_output, false, $object->check_command) ?> +
diff --git a/modules/monitoring/application/views/scripts/show/components/perfdata.phtml b/modules/monitoring/application/views/scripts/show/components/perfdata.phtml index f3cff23cc..78ea6d274 100644 --- a/modules/monitoring/application/views/scripts/show/components/perfdata.phtml +++ b/modules/monitoring/application/views/scripts/show/components/perfdata.phtml @@ -1,4 +1,4 @@ perfdata): ?>

translate('Performance data') ?>

-perfdata($object->perfdata) ?> +
perfdata($object->perfdata) ?>
diff --git a/public/css/icinga/main.less b/public/css/icinga/main.less index 42a34cc2b..39bc13d0f 100644 --- a/public/css/icinga/main.less +++ b/public/css/icinga/main.less @@ -307,7 +307,7 @@ a:hover > .icon-cancel { position: relative; overflow: hidden; - &:before { + &:before, &:after { content: ""; display: block; height: 2em; @@ -317,5 +317,23 @@ a:hover > .icon-cancel { left: 0; right: 0; z-index: 1; + + opacity: 1; + transition: opacity 2s 1s linear; + } + + &:after { + opacity: 0; + background: linear-gradient(rgba(238,238,238,0), #eee); + } +} + +.impact .collapsible.collapsed { + &:before { + opacity: 0; + } + + &:after { + opacity: 1; } } diff --git a/public/js/icinga/behavior/collapsible.js b/public/js/icinga/behavior/collapsible.js index 080e8beff..205ec8d1a 100644 --- a/public/js/icinga/behavior/collapsible.js +++ b/public/js/icinga/behavior/collapsible.js @@ -15,7 +15,7 @@ Icinga.EventListener.call(this, icinga); this.on('layout-change', this.onLayoutChange, this); - this.on('rendered', '.container', this.onRendered, this); + this.on('rendered', '#layout', this.onRendered, this); this.on('click', '.collapsible + .collapsible-control', this.onControlClicked, this); this.icinga = icinga; @@ -40,7 +40,7 @@ Collapsible.prototype.onRendered = function(event) { var _this = event.data.self; - $('.collapsible:not(.can-collapse)', event.currentTarget).each(function() { + $('.collapsible:not(.can-collapse)', event.target).each(function() { var $collapsible = $(this); // Assumes that any newly rendered elements are expanded @@ -143,6 +143,10 @@ * @returns {string} */ Collapsible.prototype.getRowSelector = function($collapsible) { + if (!! $collapsible.data('visibleHeight')) { + return ''; + } + if ($collapsible.is('table')) { return '> tbody > tr'; } else if ($collapsible.is('ul, ol')) { @@ -162,18 +166,14 @@ Collapsible.prototype.canCollapse = function($collapsible) { var rowSelector = this.getRowSelector($collapsible); if (!! rowSelector) { - return $(rowSelector, $collapsible).length > ($collapsible.data('visibleRows') || this.defaultVisibleRows); + var visibleRows = $collapsible.data('visibleRows') || this.defaultVisibleRows; + + return $(rowSelector, $collapsible).length > visibleRows * 2; } else { var actualHeight = $collapsible[0].scrollHeight; var maxHeight = $collapsible.data('visibleHeight') || this.defaultVisibleHeight; - if (actualHeight <= maxHeight) { - return false; - } - - // Although the height seems larger than what it should be, make sure it's not just a small fraction - // i.e. more than 12 pixel and at least 10% difference - return actualHeight - maxHeight > 12 && actualHeight / maxHeight >= 1.1; + return actualHeight >= maxHeight * 2; } }; diff --git a/public/js/icinga/storage.js b/public/js/icinga/storage.js index d9df2c668..f85d14b33 100644 --- a/public/js/icinga/storage.js +++ b/public/js/icinga/storage.js @@ -234,9 +234,9 @@ }, this); } - if (!! items && items.length) { + if (!! items && Object.keys(items).length) { storage.set(key, items); - } else if(items !== null) { + } else if (items !== null) { storage.remove(key); }
getRenderer() ?> - markdown($notes) ?> + markdown($notes, [ + 'id' => $object->type . '-notes', + 'class' => 'collapsible', + 'data-visible-height' => 200 + ]) ?>