diff --git a/modules/monitoring/application/views/scripts/list/servicegrid.phtml b/modules/monitoring/application/views/scripts/list/servicegrid.phtml index 2d50a067d..845cac745 100644 --- a/modules/monitoring/application/views/scripts/list/servicegrid.phtml +++ b/modules/monitoring/application/views/scripts/list/servicegrid.phtml @@ -81,7 +81,7 @@ $hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . ' $service->service_display_name, $service->host_display_name ), - 'class' => 'bg-color-' . Service::getStateText($service->service_state) . ($service->service_handled ? ' handled' : ''), + 'class' => 'service-grid-link state-' . Service::getStateText($service->service_state) . ($service->service_handled ? ' handled' : ''), 'title' => $service->service_output ) ) ?> diff --git a/modules/monitoring/application/views/scripts/show/components/checksource.phtml b/modules/monitoring/application/views/scripts/show/components/checksource.phtml index 8f069a09b..470b4de55 100644 --- a/modules/monitoring/application/views/scripts/show/components/checksource.phtml +++ b/modules/monitoring/application/views/scripts/show/components/checksource.phtml @@ -8,9 +8,9 @@ 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')); + echo $this->icon('circle', $this->translate('Is reachable'), array('class' => 'icon-stateful state-ok')); } else { - echo $this->icon('circle', $this->translate('Not reachable'), array('class' => 'check-source-not-reachable')); + echo $this->icon('circle', $this->translate('Not reachable'), array('class' => 'icon-stateful state-critical')); } ?> diff --git a/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml b/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml index 0ddcbcaa8..8ae18c899 100644 --- a/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml +++ b/modules/monitoring/application/views/scripts/show/components/checkstatistics.phtml @@ -9,7 +9,7 @@ $activeChecksEnabled = (bool) $object->active_checks_enabled; state !== 99): ?> timeAgo($object->last_check) ?> next_update < time()): ?> - icon('circle', $this->translate('Check result is late'), array('class' => 'check-result-late')) ?> + icon('circle', $this->translate('Check result is late'), array('class' => 'icon-stateful state-critical')) ?> .icon-cancel { color: @color-critical; } +.icon-stateful { + .fg-stateful(); +} + // Link styles .button-link { diff --git a/public/css/icinga/mixins.less b/public/css/icinga/mixins.less index 48b7d1839..984f51de2 100644 --- a/public/css/icinga/mixins.less +++ b/public/css/icinga/mixins.less @@ -114,88 +114,88 @@ animation-fill-mode: forwards; } -// Color mixins - -.bg-color-ok, -.bg-color-up { - background-color: @color-ok; -} - -.bg-color-warning { - background-color: @color-warning; - - &.handled { - background-color: @color-warning-handled; +// Mixin for stateful foreground colors, e.g. text or icons +.fg-stateful { + &.state-ok { + color: @color-ok; + } + &.state-up { + color: @color-up; + } + &.state-warning { + color: @color-warning; + &.handled { + color: @color-warning-handled; + } + } + &.state-critical { + color: @color-critical; + &.handled { + color: @color-critical-handled; + } + } + &.state-down { + color: @color-down; + &.handled { + color: @color-down-handled; + } + } + &.state-unreachable { + color: @color-unreachable; + &.handled { + color: @color-unreachable-handled; + } + } + &.state-unknown { + color: @color-unknown; + &.handled { + color: @color-unknown-handled; + } + } + &.state-pending { + color: @color-pending; } } -.bg-color-critical, -.bg-color-down { - background-color: @color-critical; - - &.handled { - background-color: @color-critical-handled; +// Mixin for stateful background colors +.bg-stateful { + &.state-ok { + background-color: @color-ok; + } + &.state-up { + background-color: @color-up; + } + &.state-warning { + background-color: @color-warning; + &.handled { + background-color: @color-warning-handled; + } + } + &.state-critical { + background-color: @color-critical; + &.handled { + background-color: @color-critical-handled; + } + } + &.state-down { + background-color: @color-down; + &.handled { + background-color: @color-down-handled; + } + } + &.state-unreachable { + background-color: @color-unreachable; + &.handled { + background-color: @color-unreachable-handled; + } + } + &.state-unknown { + background-color: @color-unknown; + &.handled { + background-color: @color-unknown-handled; + } + } + &.state-pending { + background-color: @color-pending; } } - -.bg-color-unreachable { - background-color: @color-unreachable; - - &.handled { - background-color: @color-unreachable-handled; - } -} - -.bg-color-unknown { - background-color: @color-unknown; - - &.handled { - background-color: @color-unknown-handled; - } -} - -.bg-color-pending { - background-color: @color-pending; -} - -.fg-color-ok, -.fg-color-up { - color: @color-ok; -} - -.fg-color-warning { - color: @color-warning; - - &.handled { - color: @color-warning-handled; - } -} - -.fg-color-critical, -.fg-color-down { - color: @color-critical; - - &.handled { - color: @color-critical-handled; - } -} - -.fg-color-unreachable { - color: @color-unreachable; - - &.handled { - color: @color-unreachable-handled; - } -} - -.fg-color-unknown { - color: @color-unknown; - - &.handled { - color: @color-unknown-handled; - } -} - -.fg-color-pending { - color: @color-pending; -}