X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/c912d9d8d9e2a055a53967c5b01242c321dfbeb6..921c13a95c2d13c94de74601e5bc26e5b0c71c31:/apps/workbench/app/helpers/provenance_helper.rb diff --git a/apps/workbench/app/helpers/provenance_helper.rb b/apps/workbench/app/helpers/provenance_helper.rb index c0b2fd36f8..66754d20b2 100644 --- a/apps/workbench/app/helpers/provenance_helper.rb +++ b/apps/workbench/app/helpers/provenance_helper.rb @@ -26,6 +26,14 @@ module ProvenanceHelper end end + def url_for u + p = { :host => @opts[:request].host, + :port => @opts[:request].port, + :protocol => @opts[:request].protocol } + p.merge! u + Rails.application.routes.url_helpers.url_for (p) + end + def determine_fillcolor(n) fillcolor = %w(aaaaaa aaffaa aaaaff aaaaaa ffaaaa)[n || 0] || 'aaaaaa' "style=filled,fillcolor=\"##{fillcolor}\"" @@ -37,11 +45,9 @@ module ProvenanceHelper rsc = ArvadosBase::resource_class_for_uuid uuid.to_s if rsc - href = Rails.application.routes.url_helpers.url_for ({:controller => rsc.to_s.tableize, - :action => :show, - :id => uuid.to_s, - :host => @opts[:request].host, - :port => @opts[:request].port}) + href = url_for ({:controller => rsc.to_s.tableize, + :action => :show, + :id => uuid.to_s }) #"\"#{uuid}\" [label=\"#{rsc}\\n#{uuid}\",href=\"#{href}\"];\n" if rsc == Collection @@ -80,8 +86,8 @@ module ProvenanceHelper end end end - return "\"#{uuid}\" [label=\"#{rsc}\",href=\"#{href}\",#{bgcolor}];\n" end + return "\"#{uuid}\" [label=\"#{rsc}\",href=\"#{href}\",#{bgcolor}];\n" end "\"#{uuid}\" [#{bgcolor}];\n" end @@ -227,11 +233,9 @@ module ProvenanceHelper @pdata.each do |k, link| if link[:head_uuid] == uuid.to_s and link[:link_class] == "provenance" - href = Rails.application.routes.url_helpers.url_for ({:controller => Link.to_s.tableize, - :action => :show, - :id => link[:uuid], - :host => @opts[:request].host, - :port => @opts[:request].port}) + href = url_for ({:controller => Link.to_s.tableize, + :action => :show, + :id => link[:uuid] }) gr += describe_node(link[:tail_uuid]) gr += edge(link[:head_uuid], link[:tail_uuid], {:label => link[:name], :href => href}) @@ -247,10 +251,8 @@ module ProvenanceHelper def describe_jobs gr = "" @jobs.each do |k, v| - href = Rails.application.routes.url_helpers.url_for ({:controller => Job.to_s.tableize, - :action => :index, - :host => @opts[:request].host, - :port => @opts[:request].port}) + href = url_for ({:controller => Job.to_s.tableize, + :action => :index }) gr += "\"#{k}\" [href=\"#{href}?"