Skip to content

Commit

Permalink
Merge pull request #5103 from lpichler/fix_provider_link_on_cloud_eve…
Browse files Browse the repository at this point in the history
…nt_bubble

Fix provider link on cloud event bubble
  • Loading branch information
h-kataria committed Oct 28, 2015
2 parents 4162d47 + 8e65260 commit fdb45b1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/report_formatter/timeline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def tl_event(tl_xml, row, col)
e_icon = "/images/icons/timeline/vendor-#{rec.vmm_vendor.downcase}.png"
e_image = "/images/icons/new/os-#{rec.os_image_name.downcase}.png"
e_text = "<a href='/host/show/#{rec.id}'>#{e_title}</a>"
when "EmsEvent"
when "EventStream"
ems_cloud = false
if rec[:ems_id] && ExtManagementSystem.exists?(rec[:ems_id])
ems = ExtManagementSystem.find(rec[:ems_id])
Expand Down Expand Up @@ -245,7 +245,13 @@ def tl_event(tl_xml, row, col)
elsif co == "ems_cluster_name" && !rec.ems_cluster_id.nil?
e_text += "<a href='/ems_cluster/show/#{to_cid(rec.ems_cluster_id)}'>#{row[co]}</a>"
elsif co == "ext_management_system.name" && rec.ext_management_system && !rec.ext_management_system.id.nil?
e_text += "<a href='/#{ems_cloud ? "ems_cloud" : "ems_infra"}/show/#{to_cid(rec.ext_management_system.id)}'>#{row[co]}</a>"
provider_id = rec.ext_management_system.id
if ems_cloud
# restful route is used for cloud provider unlike infrastructure provider
e_text += "<a href='/ems_cloud/#{provider_id}'>#{row[co]}</a>"
else
e_text += "<a href='/ems_infra/show/#{to_cid(provider_id)}'>#{row[co]}</a>"
end
elsif co == "availability_zone.name" && !rec.availability_zone_id.nil?
e_text += "<a href='/availability_zone/show/#{to_cid(rec.availability_zone_id)}'>#{row[co]}</a>"
elsif mri.db == "BottleneckEvent" && co == "resource_name"
Expand Down

0 comments on commit fdb45b1

Please sign in to comment.