2882: Removed unnecessary no_reuse options
[arvados.git] / apps / workbench / app / views / jobs / _show_status.html.erb
1
2 <div class="pull-right">
3   <% if @object.running %>
4     <%= form_tag "/jobs/#{@object.uuid}/cancel", style: "display:inline; padding-left: 1em" do |f| %>
5       <%= button_tag "Cancel running job", {class: 'btn btn-danger', id: "cancel-job-button"} %>
6     <% end %>
7   <% else %>
8     Re-run job using script version:
9     <%= form_tag '/jobs', style: "display:inline; padding-left: 1em" do |f| %>
10       <% [:script, :script_version, :repository, :output_is_persistent, :supplied_script_version, :nondeterministic].each do |d| %>
11         <%= hidden_field :job, d, :value => @object[d] %>
12       <% end %>
13       <% [:script_parameters, :runtime_constraints].each do |d| %>
14         <%= hidden_field :job, d, :value => JSON.dump(@object[d]) %>
15       <% end %>
16       <%= button_tag "Same as this run", {class: 'btn btn-primary', id: "re-run-same-job-button"} %>
17     <% end %>
18   <% if !@object.supplied_script_version.nil? and !@object.supplied_script_version.empty? and @object.script_version != @object.supplied_script_version%>
19       <%= form_tag '/jobs', style: "display:inline" do |f| %>
20       <% [:script, :repository, :output_is_persistent, :supplied_script_version, :nondeterministic].each do |d| %>
21         <%= hidden_field :job, d, :value => @object[d] %>
22       <% end %>
23       <%= hidden_field :job, :script_version, :value => @object[:supplied_script_version] %>
24       <% [:script_parameters, :runtime_constraints].each do |d| %>
25         <%= hidden_field :job, d, :value => JSON.dump(@object[d]) %>
26       <% end %>
27       <%= button_tag "Latest (#{@object.repository}/#{@object.supplied_script_version})", {class: 'btn btn-primary', id: "re-run-latest-job-button"} %>
28     <% end %>
29   <% end %>
30 <% end %>
31 </div>
32
33 <table class="table pipeline-components-table">
34   <colgroup>
35     <col style="width: 20%" />
36     <col style="width: 24%" />
37     <col style="width: 12%" />
38     <col style="width: 45%" />
39   </colgroup>
40   <thead>
41     <tr><th>
42         script, version
43       </th><th>
44         progress
45         <%# format:'js' here helps browsers avoid using the cached js
46             content in html context (e.g., duplicate tab -> see
47                                      javascript) %>
48         <%= link_to '(refresh)', {format: :js}, {class: 'refresh hide', remote: true, method: 'get'} %>
49       </th>
50       <th></th>
51       <th>
52         output
53       </th>
54     </tr>
55   </thead>
56   <tbody>
57     <tr>
58       <td>
59         <%= @object[:script] %><br>
60         <span class="deemphasize"><%= @object[:script_version] %></span>
61       </td>
62       <td>
63         <%= render partial: 'job_progress', locals: {:j => @object} %>
64         <% if @object.running == false %>
65           <% if @object[:job].andand[:uuid] %>
66             <span class="deemphasize">
67               <%= link_to("..."+@object[:job][:uuid].last(15), job_url(id: @object[:job][:uuid])) %>
68             </span>
69
70             <% current_job = @object %>
71             <% if current_job.andand[:log] %>
72               <% fixup = /([a-f0-9]{32}\+\d+)(\+?.*)/.match(current_job[:log])%>
73               <% Collection.limit(1).where(uuid: fixup[1]).each do |c| %>
74                 <% c.files.each do |file| %>
75                   <br/><span class="deemphasize">
76                     <a href="<%= collection_path(current_job[:log]) %>/<%= file[1] %>?disposition=inline&size=<%= file[2] %>">log</a>
77                   </span>
78                 <% end %>
79               <% end %>
80             <% end %>
81           <% end %>
82         <% end %>
83       </td><td>
84         <%= render(partial: 'job_status_label',
85                    locals: { :j => @object }) %>
86       </td><td>
87         <%= link_to_if_arvados_object @object[:output], {:thumbnail => true} %>
88       </td>
89     </tr>
90     <tfoot>
91       <tr><td colspan="5"></td></tr>
92     </tfoot>
93 </table>