Skip to content

Commit

Permalink
Fix incorrect image on Bottleneck Event Bubble
Browse files Browse the repository at this point in the history
  • Loading branch information
bmclaughlin committed Feb 18, 2016
1 parent 6e866f6 commit cd723c4
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/report_formatter/timeline.rb
Expand Up @@ -87,7 +87,7 @@ def tl_event(tl_xml, row, col)
when "BottleneckEvent"
# e_title = "#{ui_lookup(:model=>rec[:resource_type])}: #{rec[:resource_name]}"
e_title = rec[:resource_name]
e_image = ActionController::Base.helpers.image_path("100/#{bubble_icon(rec[:resource_type])}.png")
e_image = ActionController::Base.helpers.image_path("100/#{bubble_icon(rec)}.png")
e_icon = ActionController::Base.helpers.image_path("timeline/#{rec.event_type.downcase}_#{rec[:severity]}.png")
# e_text = e_title # Commented out since name is showing in the columns anyway
when "Vm"
Expand Down Expand Up @@ -299,16 +299,20 @@ def tl_event(tl_xml, row, col)
end
end

def bubble_icon(typ)
case typ.downcase
def bubble_icon(rec)
case rec.resource_type.downcase
when "emscluster"
return "cluster"
when "miqenterprise"
return "enterprise"
when "extmanagementsystem"
return "ems"
if rec.resource.kind_of?(ExtManagementSystem) && rec.resource.emstype == "rhevm"
return "vendor-redhat"
else
return "ems"
end
else
return typ.downcase
return rec.resource_type.downcase
end
end

Expand Down

0 comments on commit cd723c4

Please sign in to comment.