From bd5a2ebaa38bc6c74cbe690f7c4dd73a87db0595 Mon Sep 17 00:00:00 2001 From: Florian Strohmaier Date: Thu, 24 Nov 2016 10:42:14 +0100 Subject: [PATCH] Move status summary in the host and service list views to the bottom of the page Signed-off-by: Eric Lippmann --- .../views/scripts/list/hosts.phtml | 9 +++-- .../views/scripts/list/services.phtml | 9 +++-- modules/monitoring/public/css/module.less | 35 +++++++++++++++++++ public/js/icinga/ui.js | 11 ++++-- 4 files changed, 58 insertions(+), 6 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/hosts.phtml b/modules/monitoring/application/views/scripts/list/hosts.phtml index da20cb990..da00fccc6 100644 --- a/modules/monitoring/application/views/scripts/list/hosts.phtml +++ b/modules/monitoring/application/views/scripts/list/hosts.phtml @@ -4,8 +4,6 @@ use Icinga\Module\Monitoring\Object\Host; if (! $this->compact): ?>
tabs ?> - render('list/components/hostssummary.phtml') ?> - render('list/components/selectioninfo.phtml') ?> paginator ?>
limiter ?> @@ -107,3 +105,10 @@ if (! $this->compact): ?>
+compact): ?> +
+
+ render('list/components/hostssummary.phtml') ?> + render('list/components/selectioninfo.phtml') ?> +
+ diff --git a/modules/monitoring/application/views/scripts/list/services.phtml b/modules/monitoring/application/views/scripts/list/services.phtml index e6793db86..c9f1e855b 100644 --- a/modules/monitoring/application/views/scripts/list/services.phtml +++ b/modules/monitoring/application/views/scripts/list/services.phtml @@ -5,8 +5,6 @@ use Icinga\Module\Monitoring\Object\Service; if (! $this->compact): ?>
tabs ?> - render('list/components/servicesummary.phtml') ?> - render('list/components/selectioninfo.phtml') ?> paginator ?>
limiter ?> @@ -112,3 +110,10 @@ if (! $this->compact): ?>
+compact): ?> +
+
+ render('list/components/servicesummary.phtml') ?> + render('list/components/selectioninfo.phtml') ?> +
+ diff --git a/modules/monitoring/public/css/module.less b/modules/monitoring/public/css/module.less index 977df49b4..db01f8719 100644 --- a/modules/monitoring/public/css/module.less +++ b/modules/monitoring/public/css/module.less @@ -1,5 +1,40 @@ /*! Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */ +// Styles for the bottom status bar in the host and service list views +.monitoring-statusbar-ghost { + display: block; + visibility: hidden; +} + +.monitoring-statusbar { + background-color: @body-bg-color; + border-top: 1px solid @gray-lighter; + bottom: 0; + padding: .25em @gutter; + position: fixed; + + &:before { + background: -webkit-linear-gradient(bottom, @body-bg-color 0%, rgba(255,255,255,0) 100%); + background: -moz-linear-gradient(bottom, @body-bg-color 0%, rgba(255,255,255,0) 100%); + background: -ms-linear-gradient(bottom, @body-bg-color 0%, rgba(255,255,255,0) 100%); + background: -o-linear-gradient(bottom, @body-bg-color 0%, rgba(255,255,255,0) 100%); + background: linear-gradient(bottom, @body-bg-color 0%, rgba(255,255,255,0) 100%); + content: ""; + display: block; + height: 6px; + position: absolute; + left: 0; + right: 0; + top: -7px; + } + + .services-summary, + .hosts-summary { + float: left; + margin-bottom: 0; + } +} + // Styles for the icon displayed if a check result is late .check-result-late { &:before { diff --git a/public/js/icinga/ui.js b/public/js/icinga/ui.js index feaababd7..484014af5 100644 --- a/public/js/icinga/ui.js +++ b/public/js/icinga/ui.js @@ -657,14 +657,21 @@ $container.find('.controls').each(function() { var $controls = $(this); var $fakeControls = $controls.next('.fake-controls'); - $controls.css({ top: $container.offset().top, width: $fakeControls.outerWidth() }); - $fakeControls.height($controls.height()); }); + + var $statusBar = $container.children('.monitoring-statusbar'); + if ($statusBar.length) { + $statusBar.css({ + left: $container.offset().left, + width: $container.width() + }); + $statusBar.prev('.monitoring-statusbar-ghost').height($statusBar.outerHeight(true)); + } }, toggleFullscreen: function () {