Skip to content

Commit

Permalink
100% opacity on SOFT state icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Subiron committed Sep 3, 2017
1 parent 4e7e622 commit b47d042
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions module/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down Expand Up @@ -438,22 +439,27 @@ def get_fa_icon_state(self, obj=None, cls='host', state='UP', disabled=False, la
back += '''<i class="fa fa-circle fa-stack-1x font-%s"></i>''' % (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 = '''<i class="fa fa-%s fa-stack-1x %s"></i>''' % (icon, icon_color)

if useTitle:
Expand Down

0 comments on commit b47d042

Please sign in to comment.