From 18e3884b8ba1353037649ed29a2287333002ae91 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 23 Feb 2016 15:41:01 +0100 Subject: [PATCH] monitoring: Fix order of information and actions in the check execution part in the detail area fixes #10310 --- .../scripts/show/components/checksource.phtml | 12 ++++----- .../show/components/checkstatistics.phtml | 26 +++++++++---------- modules/monitoring/public/css/module.less | 21 +++++++++++++++ 3 files changed, 39 insertions(+), 20 deletions(-) diff --git a/modules/monitoring/application/views/scripts/show/components/checksource.phtml b/modules/monitoring/application/views/scripts/show/components/checksource.phtml index 5e65e9d33..8f069a09b 100644 --- a/modules/monitoring/application/views/scripts/show/components/checksource.phtml +++ b/modules/monitoring/application/views/scripts/show/components/checksource.phtml @@ -4,16 +4,14 @@ translate('Check Source') ?> - is_reachable !== null) { - if ((bool) $object->is_reachable) { - echo $this->icon('circle', $this->translate('Is reachable'), array('class' => 'fg-color-ok')); - } else { - echo $this->icon('circle', $this->translate('Not reachable'), array('class' => 'fg-color-critical')); - } - } ?> escape($object->check_source) ?> is_reachable !== null): ?> is_reachable ? $this->translate('is reachable') : $this->translate('is not reachable') ?> + is_reachable) { + echo $this->icon('circle', $this->translate('Is reachable'), array('class' => 'check-source-reachable')); + } else { + echo $this->icon('circle', $this->translate('Not reachable'), array('class' => 'check-source-not-reachable')); + } ?> diff --git a/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml b/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml index b88243cf7..0ddcbcaa8 100644 --- a/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml +++ b/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml @@ -6,18 +6,28 @@ $activeChecksEnabled = (bool) $object->active_checks_enabled; translate('Last check') : $this->translate('Last update') ?> +state !== 99): ?> + timeAgo($object->last_check) ?> + next_update < time()): ?> + icon('circle', $this->translate('Check result is late'), array('class' => 'check-result-late')) ?> + + - state !== 99) { - echo $this->timeAgo($object->last_check); - } ?> translate('Next check') : $this->translate('Next update') ?> + state !== 99) { + if ($activeChecksEnabled) { + echo $this->timeUntil($object->next_check); + } else { + echo sprintf($this->translate('expected %s'), $this->timeUntil($object->next_update)); + } + } ?> hasPermission('monitoring/command/schedule-check')) { if ($object->getType() === $object::TYPE_SERVICE) { echo $this->qlink( @@ -49,16 +59,6 @@ $activeChecksEnabled = (bool) $object->active_checks_enabled; ); } } ?> - state !== 99) { - if ($activeChecksEnabled) { - echo $this->timeUntil($object->next_check); - } else { - echo sprintf($this->translate('expected %s'), $this->timeUntil($object->next_update)); - } - } ?> - next_update < time()) { - echo $this->icon('circle', $this->translate('Check result is late'), array('class' => 'fg-color-critical')); - } ?> diff --git a/modules/monitoring/public/css/module.less b/modules/monitoring/public/css/module.less index 5e6bc1aae..c0c2fb023 100644 --- a/modules/monitoring/public/css/module.less +++ b/modules/monitoring/public/css/module.less @@ -1,5 +1,26 @@ /*! Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */ +// Styles for the icon displayed if a check source is reachable +.check-source-reachable { + color: @color-ok; +} + +// Styles for the icon displayed if a check source is not reachable +.check-source-not-reachable { + color: @color-critical; +} + +// Styles for the icon displayed if a check result is late +.check-result-late { + color: @color-critical; + + &:before { + // Remove right margin because the check now form may be displayed right next to the icon and we already have a gap + // because of inline-blocks + margin-right: 0; + } +} + // Show more and load more links in overviews .action-links { text-align: right;