From b47d04242f02dcdac9f6a7e5cd85e51535f58e78 Mon Sep 17 00:00:00 2001 From: Guillaume Subiron Date: Sun, 3 Sep 2017 18:37:20 +0200 Subject: [PATCH] 100% opacity on SOFT state icons --- module/helper.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/module/helper.py b/module/helper.py index ec005575..b6732782 100644 --- a/module/helper.py +++ b/module/helper.py @@ -409,6 +409,7 @@ def get_fa_icon_state(self, obj=None, cls='host', state='UP', disabled=False, la flapping = (obj and obj.is_flapping) or state=='FLAPPING' ack = (obj and obj.problem_has_been_acknowledged) or state=='ACK' downtime = (obj and obj.in_scheduled_downtime) or state=='DOWNTIME' + hard = (obj and obj.state_type == 'HARD') # Icons depending upon element and real state ... icons = { 'host': @@ -438,22 +439,27 @@ def get_fa_icon_state(self, obj=None, cls='host', state='UP', disabled=False, la back += '''''' % (state.lower() if not disabled else 'greyed') title = "%s is %s" % (cls, state) + if flapping: icon_color = 'fa-inverse' if not disabled else 'font-greyed' title += " and is flapping" else: icon_color = 'fa-inverse' + + if downtime or ack or not hard: + icon_style = 'style="opacity: 0.5"' + else: + icon_style = "" + if downtime: icon = icons[cls]['DOWNTIME'] title += " and in scheduled downtime" - icon_style = 'style="opacity: 0.5"' elif ack: icon = icons[cls]['ACK'] title += " and acknowledged" - icon_style = 'style="opacity: 0.5"' else: icon = icons[cls].get(state, 'UNKNOWN') - icon_style = "" + front = '''''' % (icon, icon_color) if useTitle: