3342: Fixing outputs
[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         <% puts pj %>
27         <tr data-object-uuid="<%= pj[:job].andand[:uuid] %>">
28           <td>
29             <%= pj[:name] %>
30           </td><td>
31             <%= pj[:script] %>
32             <br /><span class="deemphasize"><%= pj[:script_version] %></span>
33           </td><td>
34             <%= render(partial: 'job_status_label', locals: { j: pj[:job] }) %>
35           </td><td>
36             <%= pj[:progress_bar] %>
37           </td>
38           <% current_job = pj[:job] rescue nil %>
39           <td>
40             <% if current_job %>
41               <%= render partial: 'show_object_button', locals: {object: current_job, size: 'xs', link_text: 'Show job details'} %>
42             <% end %>
43           </td><td>
44             <% if current_job.andand[:log] %>
45               <% fixup = /([a-f0-9]{32}\+\d+)(\+?.*)/.match(current_job[:log])%>
46               <% Collection.limit(1).where(uuid: fixup[1]).each do |c| %>
47                 <% c.files.first.andand do |file| %>
48                   <%= 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 %>
49                     <i class="fa fa-fw fa-info"></i> Show log messages
50                   <% end %>
51                 <% end %>
52               <% end %>
53             <% end %>
54           </td><td>
55             <% if pj[:output_uuid] %>
56                 <%= link_to_if_arvados_object pj[:output_uuid], {thumbnail: true, link_text: raw('<i class="fa fa-fw fa-archive"></i> Show output files')}, {class: 'btn btn-default btn-xs'} %>
57             <% elsif 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>