Merge branch 'master' into 3188-remove-selected-button
[arvados.git] / apps / workbench / app / views / pipeline_instances / _show_components_running.html.erb
1   <table class="table pipeline-components-table">
2     <colgroup>
3       <col style="width: 15%" />
4       <col style="width: 25%" />
5       <col style="width: 8%" />
6       <col style="width: 13%" />
7       <col style="width: 12%" />
8       <col style="width: 14%" />
9       <col style="width: 13%" />
10     </colgroup>
11     <thead>
12       <tr>
13         <th colspan="2">
14           component
15         </th><th colspan="5">
16           job
17           <%# format:'js' here helps browsers avoid using the cached js
18           content in html context (e.g., duplicate tab -> see
19           javascript) %>
20           <%= link_to '(refresh)', {format: :js}, {class: 'refresh hide', remote: true, method: 'get'} %>
21         </th>
22       </tr>
23     </thead>
24     <tbody>
25       <% render_pipeline_jobs.each do |pj| %>
26         <tr data-object-uuid="<%= pj[:job].andand[:uuid] %>">
27           <td>
28             <%= pj[:name] %>
29           </td><td>
30             <%= pj[:script] %>
31             <br /><span class="deemphasize"><%= pj[:script_version] %></span>
32           </td><td>
33             <%= render(partial: 'job_status_label', locals: { j: pj[:job] }) %>
34           </td><td>
35             <%= pj[:progress_bar] %>
36           </td>
37           <% current_job = Job.find(pj[:job][:uuid]) rescue nil %>
38           <td>
39             <% if current_job %>
40               <%= render partial: 'show_object_button', locals: {object: current_job, size: 'xs', link_text: 'Show job details'} %>
41             <% end %>
42           </td><td>
43             <% if current_job.andand[:log] %>
44               <% fixup = /([a-f0-9]{32}\+\d+)(\+?.*)/.match(current_job[:log])%>
45               <% Collection.limit(1).where(uuid: fixup[1]).each do |c| %>
46                 <% c.files.first.andand do |file| %>
47                   <%= link_to url_for(controller: 'collections', action: 'show_file', uuid: current_job[:log], file: "#{file[0]}/#{file[1]}", disposition: 'inline', size: file[2]), class: 'btn btn-default btn-xs' do %>
48                     <i class="fa fa-fw fa-info"></i> Show log messages
49                   <% end %>
50                 <% end %>
51               <% end %>
52             <% end %>
53           </td><td>
54             <% if current_job.andand[:output] %>
55               <%= link_to_if_arvados_object current_job[:output], {thumbnail: true, link_text: raw('<i class="fa fa-fw fa-archive"></i> Show output files')}, {class: 'btn btn-default btn-xs'} %>
56             <% end %>
57           </td>
58         </tr>
59       <% end %>
60     </tbody>
61     <tfoot>
62       <tr><td colspan="7"></td></tr>
63     </tfoot>
64   </table>