pj
end
- def pipieline_log_history(job_uuids)
+ def pipeline_log_history(job_uuids)
results = []
- log_history = Log.where(event_type: 'transient-log-entry',
- object_uuid: job_uuids).order('id DESC').limit(20).all
+ 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|
- summary = entry.summary
- results = results.concat summary.split("\n")
+ if entry.andand.properties
+ properties = entry.properties
+ text = properties[:text]
+ if text
+ results = results.concat text.split("\n")
+ end
+ end
end
end
end
if pj[:job][:success]
pj[:result] = 'complete'
+ pj[:labeltype] = 'success'
pj[:complete] = true
pj[:progress] = 1.0
elsif pj[:job][:finished_at]
pj[:result] = 'failed'
+ pj[:labeltype] = 'danger'
pj[:failed] = true
elsif pj[:job][:started_at]
pj[:result] = 'running'
+ pj[:labeltype] = 'primary'
elsif pj[:job][:uuid]
pj[:result] = 'queued'
+ pj[:labeltype] = 'default'
else
pj[:result] = 'none'
+ pj[:labeltype] = 'default'
end
pj[:job_id] = pj[:job][:uuid]
pj[:script] = pj[:job][:script] || c[:script]