Merge branch 'master' into 1971-show-image-thumbnails
[arvados.git] / apps / workbench / app / views / pipeline_instances / _show_components.html.erb
1 <% content_for :css do %>
2
3 <% end %>
4
5 <% template = PipelineTemplate.find(@object.pipeline_template_uuid) rescue nil %>
6
7 <%= content_for :content_top do %>
8   <h2>
9     <%= render_editable_attribute @object, 'name', nil, { 'data-emptytext' => 'Unnamed pipeline', 'data-mode' => 'inline' } %>
10   </h2>
11   <% if template %>
12   <h4>
13     From template:
14     <%= link_to_if_arvados_object template, friendly_name: true %>
15   </h4>
16   <% end %>
17 <% end %>
18
19 <% if @object.active != nil %>
20 <table class="table pipeline-components-table">
21   <colgroup>
22     <col style="width: 15%" />
23     <col style="width: 20%" />
24     <col style="width: 12%" />
25     <col style="width: 12%" />
26     <col style="width: 45%" />
27   </colgroup>
28   <thead>
29     <tr>
30       <th>
31         component
32       </th><th>
33         script, version
34       </th><th>
35         progress
36         <%= link_to '(refresh)', request.fullpath, class: 'refresh', remote: true, method: 'get' %>
37       </th><th>
38       </th><th>
39         output
40       </th>
41     </tr>
42   </thead>
43   <tbody>
44     <% render_pipeline_jobs.each do |pj| %>
45     <tr>
46       <td>
47         <% job_status = render(partial: 'job_status_label',
48                                locals: { :j => pj[:job], :title => pj[:name] }) %>
49         <% if pj[:job].andand[:uuid] %>
50           <%= link_to(job_status, job_url(id: pj[:job][:uuid])) %>
51         <% else %>
52           <%= job_status %>
53         <% end %>
54       </td><td>
55         <%= pj[:script] %>
56         <br /><span class="deemphasize"><%= pj[:script_version] %></span>
57       </td><td>
58         <%= pj[:progress_bar] %>
59       </td><td>
60         <%= render(partial: 'job_status_label',
61                                locals: { :j => pj[:job] }) %>
62       </td><td>
63         <%= link_to_if_arvados_object pj[:output] %>
64       </td>
65     </tr>
66     <% end %>
67   </tbody>
68   <tfoot>
69     <tr><td colspan="5"></td></tr>
70   </tfoot>
71 </table>
72
73 <% if @object.active %>
74 <% content_for :js do %>
75 setInterval(function(){$('a.refresh').click()}, 15000);
76 <% end %>
77
78 <% content_for :tab_line_buttons do %>
79   <%= form_tag @object, :method => :put do |f| %>
80
81     <%= hidden_field @object.class.to_s.underscore.singularize.to_sym, :active, :value => false %>
82
83     <%= button_tag "Stop pipeline", {class: 'btn btn-primary pull-right', id: "run-pipeline-button"} %>
84   <% end %>
85 <% end %>
86
87 <% end %>
88
89 <% else %>
90
91   <p>Please set the desired input parameters for the components of this pipeline.  Parameters highlighted in red are required.</p>
92
93   <% content_for :tab_line_buttons do %>
94     <%= form_tag @object, :method => :put do |f| %>
95
96       <%= hidden_field @object.class.to_s.underscore.singularize.to_sym, :active, :value => true %>
97
98       <%= button_tag "Run pipeline", {class: 'btn btn-primary pull-right', id: "run-pipeline-button"} %>
99     <% end %>
100   <% end %>
101
102   <%= render partial: 'pipeline_templates/show_components_template', locals: {:template => template, :obj => @object} %>
103
104 <% end %>