%
rows = @historical_jobs.each do |job|
historical_job = ::Naf::HistoricalJob.find_by_id(job[0])
if job[1].present? && historical_job.present? && historical_job.machine_runner_invocation.present?
invocation = historical_job.machine_runner_invocation
if invocation.status != 'dead' && job[10] == 'Running'
job[1] = "
" + job[1] + "
".html_safe
end
end
job[12] = link_to image_tag('job.png',
class: 'action',
title: "View job(id: #{job[0]}, title: #{job[4]}) log"),
url_for({ controller: 'log_viewer', action: 'index', record_id: job[0], record_type: 'job' }),
{ target: '_blank', id: job[0] }
if job[10] == "Running" || job[10] == 'Queued' || job[10] == 'Waiting'
job[12] << " ".html_safe
job[12] << (link_to image_tag('terminate.png',
class: 'action',
title: "Terminate job(id: #{job[0]}, title: #{job[4]})"),
"#", { class: "terminate", id: job[0]})
end
end
%>
<%= raw rows %>