Merge branch 'master' into 3193-manage-account
[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         <% if pj[:job].andand[:uuid]
27              pipeline_job_uuids << pj[:job][:uuid]
28            end %>
29       <tr>
30         <td>
31           <%= pj[:name] %>
32         </td><td>
33           <%= pj[:script] %>
34           <br /><span class="deemphasize"><%= pj[:script_version] %></span>
35         </td><td>
36           <%= render(partial: 'job_status_label', locals: { j: pj[:job] }) %>
37         </td><td>
38           <%= pj[:progress_bar] %>
39         </td>
40         <% current_job = Job.find(pj[:job][:uuid]) rescue nil %>
41         <td>
42           <% if current_job %>
43             <%= render partial: 'show_object_button', locals: {object: current_job, size: 'xs', link_text: 'Show job details'} %>
44           <% end %>
45         </td><td>
46           <% if current_job.andand[:log] %>
47             <% fixup = /([a-f0-9]{32}\+\d+)(\+?.*)/.match(current_job[:log])%>
48             <% Collection.limit(1).where(uuid: fixup[1]).each do |c| %>
49               <% c.files.first.andand do |file| %>
50                 <%= 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 %>
51                   <i class="fa fa-fw fa-info"></i> Show log messages
52                 <% end %>
53               <% end %>
54             <% end %>
55           <% end %>
56         </td><td>
57           <% if current_job.andand[:output] %>
58             <%= 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'} %>
59           <% end %>
60         </td>
61       </tr>
62       <% end %>
63     </tbody>
64     <tfoot>
65       <tr><td colspan="7"></td></tr>
66     </tfoot>
67   </table>