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