app/views/naf/historical_jobs/index.json.erb in naf-2.1.12 vs app/views/naf/historical_jobs/index.json.erb in naf-2.1.13

- old
+ new

@@ -1,26 +1,47 @@ <% 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? + runner_path_name = job[1] invocation = historical_job.machine_runner_invocation if invocation.status != 'dead' && job[10] == 'Running' job[1] = "<div class='" + invocation.status + "'>" + job[1] + "</div>".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] } + 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 runner_path_name.present? + job[12] << "&nbsp;&nbsp;&nbsp;".html_safe + job[12] << (link_to image_tag('download.png', + class: 'action', + title: "Download all logs for job(id: #{job[0]}, title: #{job[4]}"), + "#{http_protocol}#{runner_path_name}#{naf.download_log_parsers_path}?record_id=#{job[0]}&record_type=job") + end + if job[10] == "Running" || job[10] == 'Queued' || job[10] == 'Waiting' job[12] << "&nbsp;&nbsp;&nbsp;".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]}) + "#", { class: "terminate", id: job[0]}, content: "#{naf.historical_jobs_path}") + elsif job[10] != 'Terminating' + # This re-enqueue link is handled by assets/javascripts/dataTableTemplates/jobs.js + params = { class: "re-enqueue", id: historical_job.id, content: "#{naf.historical_jobs_path}/reenqueue"} + if historical_job.application_id.present? + params[:app_id] = historical_job.application_id + end + job[12] << "&nbsp;&nbsp;&nbsp;".html_safe + job[12] << (link_to image_tag('control_play_blue.png', + class: 'action', + title: "Re-enqueue one instance of job #{job[4]}"), + "#", params ) end + end %> <%= raw rows %>