From 86485cb8ef06d25bf87f51b9cfdac04581c0a5f3 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 20 Nov 2014 12:44:46 +0100 Subject: [PATCH 1/4] Re-design host- and servicegroupsummary --- .../views/scripts/list/hostgroups.phtml | 53 ++----- .../views/scripts/list/servicegroups.phtml | 53 ++----- public/css/icinga/monitoring-colors.less | 134 ++++++++---------- 3 files changed, 83 insertions(+), 157 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/hostgroups.phtml b/modules/monitoring/application/views/scripts/list/hostgroups.phtml index 246de7f1f..2b8ad6c4f 100644 --- a/modules/monitoring/application/views/scripts/list/hostgroups.phtml +++ b/modules/monitoring/application/views/scripts/list/hostgroups.phtml @@ -21,46 +21,46 @@ ?> - - + + - + services_critical_last_state_change_unhandled): ?> - services_unknown_last_state_change_unhandled): ?> - services_warning_last_state_change_unhandled): ?> - services_critical_last_state_change_handled): ?> - services_unknown_last_state_change_handled): ?> - services_warning_last_state_change_handled): ?> - - - - - - - diff --git a/modules/monitoring/application/views/scripts/list/servicegroups.phtml b/modules/monitoring/application/views/scripts/list/servicegroups.phtml index 02bb00593..b7898de05 100644 --- a/modules/monitoring/application/views/scripts/list/servicegroups.phtml +++ b/modules/monitoring/application/views/scripts/list/servicegroups.phtml @@ -21,46 +21,46 @@ ?>
translate('Last Problem'); ?>translate('Host Group'); ?>translate('Last Problem'); ?>translate('Host Group'); ?> translate('Total Services'); ?>translate('Service States'); ?>translate('Service States'); ?>
+ translate('CRITICAL'); ?>
prefixedTimeSince($h->services_critical_last_state_change_unhandled); ?>
+ translate('UNKNOWN'); ?>
prefixedTimeSince($h->services_unknown_last_state_change_unhandled); ?>
+ translate('WARNING'); ?>
prefixedTimeSince($h->services_warning_last_state_change_unhandled); ?>
+ translate('CRITICAL'); ?>
prefixedTimeSince($h->services_critical_last_state_change_handled); ?>
+ translate('UNKNOWN'); ?>
prefixedTimeSince($h->services_unknown_last_state_change_handled); ?>
+ translate('WARNING'); ?>
prefixedTimeSince($h->services_warning_last_state_change_handled); ?> @@ -78,12 +78,12 @@ prefixedTimeSince($h->services_pending_last_state_change); ?>
+ hostgroup; ?> + services_total; ?> @@ -100,13 +100,7 @@ services_ok; ?> - - - - - - services_critical_unhandled): ?> - - - - - services_unknown_unhandled): ?> - - - - - services_warning_unhandled): ?> - - - - - services_pending): ?> - - -
- - + + - + services_critical_last_state_change_unhandled): ?> - services_unknown_last_state_change_unhandled): ?> - services_warning_last_state_change_unhandled): ?> - services_critical_last_state_change_handled): ?> - services_unknown_last_state_change_handled): ?> - services_warning_last_state_change_handled): ?> - - - - - - - diff --git a/public/css/icinga/monitoring-colors.less b/public/css/icinga/monitoring-colors.less index f705b7844..52154c24e 100644 --- a/public/css/icinga/monitoring-colors.less +++ b/public/css/icinga/monitoring-colors.less @@ -829,18 +829,18 @@ table.groupview { border-collapse: separate; border-spacing: 0.1em; - thead th { + th { font-size: 0.9em; + text-align: left; + white-space: nowrap; } - tbody { - tr { - &:hover { - color: #333; - } + td { + &.groupname { + width: 60%; a { - color: #333; + color: inherit; text-decoration: none; &:hover { @@ -849,19 +849,19 @@ table.groupview { } } - td.services-total { + &.total { width: 10%; - text-align: center; } - td.state { - width: 10%; - color: white; - text-align: center; + &.state { + width: 20%; + white-space: nowrap; &.change { width: 10%; - white-space: nowrap; + text-align: center; + border-left-width: 1.5em; + border-left-style: solid; padding: 0.3em 0.5em 0.3em 0.5em; strong { @@ -871,70 +871,58 @@ table.groupview { span.timesince { font-size: 0.8em; } - } + + &.ok { + border-color: @colorOk; + } - &.ok { - color: #333; - border-left-style: solid; - border-left-width: 1.5em; - border-color: @colorOk; - } + &.pending { + border-color: @colorPending; + } - &.pending { - color: #333; - border-left-style: solid; - border-left-width: 1.5em; - border-color: @colorPending; - } - - &.warning { - background-color: @colorWarning; - - &.handled { - background-color: inherit; - color: #333; - border-left-style: solid; - border-left-width: 1.5em; + &.warning { border-color: @colorWarningHandled; - } - } - &.unknown { - background-color: @colorUnknown; - - &.handled { - color: #333; - background-color: inherit; - border-left-style: solid; - border-left-width: 1.5em; - border-color: @colorUnknownHandled; - } - } - - &.critical { - background-color: @colorCritical; - - &.handled { - color: #333; - background-color: inherit; - border-left-style: solid; - border-left-width: 1.5em; - border-color: @colorCriticalHandled; - } - } - - span { - &.no-state { - color: #333; - } - - &.state { - &.handled { - margin-right: 2px; - } - - a { + &.unhandled { color: white; + border-left-width: 0; + background-color: @colorWarning; + } + } + + &.unknown { + border-color: @colorUnknownHandled; + + &.unhandled { + color: white; + border-left-width: 0; + background-color: @colorUnknown; + } + } + + &.critical { + border-color: @colorCriticalHandled; + + &.unhandled { + color: white; + border-left-width: 0; + background-color: @colorCritical; + } + } + } + + span.state { + &.handled { + margin-right: 2px; + } + + a { + font-size: 0.9em; + color: white; + text-decoration: none; + + &:hover { + text-decoration: underline; } } } From e23a7948445a3f1f8b48197e2e7e9c81dc1dd8f3 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 20 Nov 2014 12:49:10 +0100 Subject: [PATCH 2/4] There is no "highest" severity, just "some" severity --- .../controllers/ListController.php | 32 +++++++++---------- .../Backend/Ido/Query/GroupsummaryQuery.php | 2 +- .../Monitoring/DataView/Groupsummary.php | 6 ++-- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index 9ccc91be6..4ce76f4ac 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -505,14 +505,14 @@ class Monitoring_ListController extends Controller $this->filterQuery($query); $this->view->servicegroups = $query->paginate(); $this->setupSortControl(array( - 'services_highest_severity' => $this->translate('Highest Severity'), - 'servicegroup' => $this->translate('Service Group Name'), - 'services_total' => $this->translate('Total Services'), - 'services_ok' => $this->translate('Services OK'), - 'services_unknown' => $this->translate('Services UNKNOWN'), - 'services_critical' => $this->translate('Services CRITICAL'), - 'services_warning' => $this->translate('Services WARNING'), - 'services_pending' => $this->translate('Services PENDING') + 'services_severity' => $this->translate('Severity'), + 'servicegroup' => $this->translate('Service Group Name'), + 'services_total' => $this->translate('Total Services'), + 'services_ok' => $this->translate('Services OK'), + 'services_unknown' => $this->translate('Services UNKNOWN'), + 'services_critical' => $this->translate('Services CRITICAL'), + 'services_warning' => $this->translate('Services WARNING'), + 'services_pending' => $this->translate('Services PENDING') )); } @@ -552,14 +552,14 @@ class Monitoring_ListController extends Controller $this->filterQuery($query); $this->view->hostgroups = $query->paginate(); $this->setupSortControl(array( - 'services_highest_severity' => $this->translate('Highest Severity'), - 'hostgroup' => $this->translate('Host Group Name'), - 'services_total' => $this->translate('Total Services'), - 'services_ok' => $this->translate('Services OK'), - 'services_unknown' => $this->translate('Services UNKNOWN'), - 'services_critical' => $this->translate('Services CRITICAL'), - 'services_warning' => $this->translate('Services WARNING'), - 'services_pending' => $this->translate('Services PENDING') + 'services_severity' => $this->translate('Severity'), + 'hostgroup' => $this->translate('Host Group Name'), + 'services_total' => $this->translate('Total Services'), + 'services_ok' => $this->translate('Services OK'), + 'services_unknown' => $this->translate('Services UNKNOWN'), + 'services_critical' => $this->translate('Services CRITICAL'), + 'services_warning' => $this->translate('Services WARNING'), + 'services_pending' => $this->translate('Services PENDING') )); } diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/GroupsummaryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/GroupsummaryQuery.php index 17e1061e1..186a1e63e 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/GroupsummaryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/GroupsummaryQuery.php @@ -35,7 +35,7 @@ class GroupSummaryQuery extends IdoQuery 'services_warning_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND acknowledged + in_downtime + host_state = 0 THEN 1 ELSE 0 END)', 'services_critical_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND acknowledged + in_downtime + host_state = 0 THEN 1 ELSE 0 END)', 'services_unknown_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND acknowledged + in_downtime + host_state = 0 THEN 1 ELSE 0 END)', - 'services_highest_severity' => 'MAX(CASE WHEN object_type = \'service\' THEN severity ELSE 0 END)', + 'services_severity' => 'MAX(CASE WHEN object_type = \'service\' THEN severity ELSE 0 END)', 'services_ok_last_state_change' => 'MAX(CASE WHEN object_type = \'service\' AND state = 0 THEN state_change ELSE 0 END)', 'services_pending_last_state_change' => 'MAX(CASE WHEN object_type = \'service\' AND state = 99 THEN state_change ELSE 0 END)', 'services_warning_last_state_change_handled' => 'MAX(CASE WHEN object_type = \'service\' AND state = 1 AND acknowledged + in_downtime + host_state > 0 THEN state_change ELSE 0 END)', diff --git a/modules/monitoring/library/Monitoring/DataView/Groupsummary.php b/modules/monitoring/library/Monitoring/DataView/Groupsummary.php index 40c44ac40..7fe6d2e6d 100644 --- a/modules/monitoring/library/Monitoring/DataView/Groupsummary.php +++ b/modules/monitoring/library/Monitoring/DataView/Groupsummary.php @@ -36,7 +36,7 @@ class Groupsummary extends DataView 'services_warning_handled', 'services_warning_unhandled', 'services_pending', - 'services_highest_severity', + 'services_severity', 'services_ok_last_state_change', 'services_pending_last_state_change', 'services_warning_last_state_change_handled', @@ -51,8 +51,8 @@ class Groupsummary extends DataView public function getSortRules() { return array( - 'services_highest_severity' => array( - 'columns' => array('services_highest_severity'), + 'services_severity' => array( + 'columns' => array('services_severity'), 'order' => self::SORT_DESC ) ); From dfd74480c313d21b0ddfead8673a7eade1601b47 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Thu, 20 Nov 2014 12:54:00 +0100 Subject: [PATCH 3/4] Event overview: Fix unclosed element div --- .../monitoring/application/views/scripts/list/eventhistory.phtml | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/monitoring/application/views/scripts/list/eventhistory.phtml b/modules/monitoring/application/views/scripts/list/eventhistory.phtml index 6bc06e2c9..0b63a6703 100644 --- a/modules/monitoring/application/views/scripts/list/eventhistory.phtml +++ b/modules/monitoring/application/views/scripts/list/eventhistory.phtml @@ -14,6 +14,7 @@
filterEditor ?>
+
From 4ec29584a4d25cb61ef46e4e7da98e48d5f9a622 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Thu, 20 Nov 2014 13:22:38 +0100 Subject: [PATCH 4/4] CSS: Improve forms (at least a bit :)) --- public/css/icinga/forms.less | 45 +++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/public/css/icinga/forms.less b/public/css/icinga/forms.less index 1b7e10bcf..95edcaeec 100644 --- a/public/css/icinga/forms.less +++ b/public/css/icinga/forms.less @@ -173,8 +173,13 @@ form label { width: 10em; } -select, input[type=text] { +select, input[type=text], textarea { width: 20em; + display: inline-block; +} + +textarea { + height: 4em; } form .description { @@ -186,16 +191,34 @@ form .description { display: block; } -textarea { - height: 4em; +form label.has-feedback:after { + content: '\e85b'; + font-family: "ifont"; + font-style: normal; + font-weight: normal; + speak: none; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; + display: inline-block; + text-decoration: inherit; + width: 1em; + margin-right: .2em; + text-align: center; + /* opacity: .8; */ - width: 100%; -} - -input, select, textarea { - display: inline; + /* For safety - reset parent styles, that can break glyph codes*/ + font-variant: normal; + text-transform: none; + + /* fix buttons height, for twitter bootstrap */ + line-height: 1em; + + /* Animation center compensation - margins should be symmetric */ + /* remove if not needed */ + margin-left: .2em; + + /* you can be more comfortable with increased icons size */ + /* font-size: 120%; */ + + /* Uncomment for 3D effect */ + /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */ }
translate('Last Problem'); ?>translate('Service Group'); ?>translate('Last Problem'); ?>translate('Service Group'); ?> translate('Total Services'); ?>translate('Service States'); ?>translate('Service States'); ?>
+ translate('CRITICAL'); ?>
prefixedTimeSince($s->services_critical_last_state_change_unhandled); ?>
+ translate('UNKNOWN'); ?>
prefixedTimeSince($s->services_unknown_last_state_change_unhandled); ?>
+ translate('WARNING'); ?>
prefixedTimeSince($s->services_warning_last_state_change_unhandled); ?>
+ translate('CRITICAL'); ?>
prefixedTimeSince($s->services_critical_last_state_change_handled); ?>
+ translate('UNKNOWN'); ?>
prefixedTimeSince($s->services_unknown_last_state_change_handled); ?>
+ translate('WARNING'); ?>
prefixedTimeSince($s->services_warning_last_state_change_handled); ?> @@ -78,12 +78,12 @@ prefixedTimeSince($s->services_pending_last_state_change); ?>
+ servicegroup; ?> + services_total; ?> @@ -100,13 +100,7 @@ services_ok; ?> - - - - - - services_critical_unhandled): ?> - - - - - services_unknown_unhandled): ?> - - - - - services_warning_unhandled): ?> - - - - - services_pending): ?> - - -