X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a01fda456b81fcc70e857da201410936ed5c3044..78408743bab09078a7361620fc6a6be524fdac73:/apps/workbench/app/helpers/pipeline_instances_helper.rb diff --git a/apps/workbench/app/helpers/pipeline_instances_helper.rb b/apps/workbench/app/helpers/pipeline_instances_helper.rb index 238082a33b..1ed9e3ed6b 100644 --- a/apps/workbench/app/helpers/pipeline_instances_helper.rb +++ b/apps/workbench/app/helpers/pipeline_instances_helper.rb @@ -69,9 +69,8 @@ module PipelineInstancesHelper def determine_wallclock_runtime jobs timestamps = [] jobs.each do |j| - insert_at = 0 - started_at = j[:started_at] - finished_at = (if j[:finished_at] then j[:finished_at] else Time.now end) + started_at = (j.started_at if j.respond_to?(:started_at)) || (j[:started_at] if j.is_a?(Hash)) + finished_at = (j.finished_at if j.respond_to?(:finished_at)) || (j[:finished_at] if j.is_a?(Hash)) || Time.now if started_at timestamps = merge_range timestamps, started_at, finished_at end @@ -89,9 +88,9 @@ module PipelineInstancesHelper c[:job][:uuid] if c.is_a?(Hash) and c[:job].is_a?(Hash) }.compact job = {} - jobuuids.each do |jobuuid| - job[jobuuid] = Job.find?(jobuuid) - end.compact + Job.where(uuid: jobuuids).each do |j| + job[j[:uuid]] = j + end object.components.each do |cname, c| i += 1 @@ -289,7 +288,7 @@ module PipelineInstancesHelper else s = "" if days > 0 - s += "#{days}d " + s += "#{days}d" end if (hours > 0) @@ -298,7 +297,7 @@ module PipelineInstancesHelper s += "#{minutes}m" - if not round_to_min + if not round_to_min or (days == 0 and hours == 0 and minutes == 0) s += "#{seconds}s" end end @@ -306,4 +305,11 @@ module PipelineInstancesHelper raw(s) end + def render_unreadable_inputs_present + if current_user and controller.class.name.eql?('PipelineInstancesController') and unreadable_inputs_present? + raw('
' + + '

One or more inputs provided are not readable by you. ' + + 'Please correct these before you can run the pipeline.

') + end + end end