X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/40df5992d4d8071a6e10a20ecdeb0470a80764cc..aa0ae05d87711be4ba005971677d4d28849f08b9:/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 35d28d542b..bce713e880 100644 --- a/apps/workbench/app/helpers/pipeline_instances_helper.rb +++ b/apps/workbench/app/helpers/pipeline_instances_helper.rb @@ -22,37 +22,30 @@ module PipelineInstancesHelper pj end - def pipeline_log_history(job_uuids) - results = [] - - log_history = Log.where(event_type: 'stderr', - object_uuid: job_uuids).order('id DESC') - if !log_history.results.empty? - reversed_results = log_history.results.reverse - reversed_results.each do |entry| - if entry.andand.properties - properties = entry.properties - text = properties[:text] - if text - results = results.concat text.split("\n") - end - end - end - end - - return results - end - protected def pipeline_jobs_newschool object ret = [] i = -1 + jobuuids = object.components.select { |cname, c| c[:job] and c[:job][:uuid] } + job = {} + Job.where(uuid: jobuuids).each do |j| + job[j[:uuid]] = j + end + object.components.each do |cname, c| i += 1 pj = {index: i, name: cname} - pj[:job] = c[:job].is_a?(Hash) ? c[:job] : {} + if not c.is_a?(Hash) + ret << pj + next + end + if c[:job] and c[:job][:uuid] + pj[:job] = job[c[:job][:uuid]] + else + pj[:job] = c[:job].is_a?(Hash) ? c[:job] : {} + end pj[:percent_done] = 0 pj[:percent_running] = 0 if pj[:job][:success]