<% case job.state
when "running" %>
<%= link_to_remote("Stop", :url => admin_job_path(job, :command => "stop"), :method => :put, :confirm => "Are you sure?") %>
<% when "failed", "stopped" %>
<%= link_to_remote("Restart", :url => admin_job_path(job, :command => "restart"), :method => :put, :confirm => "Are you sure?") %>
<%= link_to_remote("Delete", :url => admin_job_path(job), :method => :delete, :confirm => "Are you sure?") %>
<% when "finished", "pending" %>
<%= link_to_remote("Delete", :url => admin_job_path(job), :method => :delete, :confirm => "Are you sure?") %>
<%= link_to("Download result", formatted_admin_job_path(job, :txt)) if downloadable?(job) %>
<% end %>
|
<%= render :partial => "progress_indicator",
:locals => {
:progress => job.progress,
:elapsed => job.elapsed,
:estimated => job.estimated,
:state => job.state
}
%>
|
<%= job.worker_class %>.new.<%= job.worker_method %>( <%= h truncate(job.args.map(&:inspect).join(", "), 255) %> )
started at: <%= time_ago_in_words_with_customization(job.started_at) %>,
created at: <%= time_ago_in_words_with_customization(job.created_at) %>,
updated at: <%= time_ago_in_words_with_customization(job.updated_at) %>,
state: <%= job.state %>,
progress: <%= job.progress || "n/a" %>,
result: <%=h truncate(job.result.inspect, 255) %>
|