Merge branch 'master' into 2257-inequality-conditions
[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   <% if template %>
9     <h2><%= template.name %></h2>
10   <% end %>
11 <% end %>
12
13 <% if @object.active != nil %>
14 <table class="table pipeline-components-table">
15   <colgroup>
16     <col style="width: 15%" />
17     <col style="width: 20%" />
18     <col style="width: 12%" />
19     <col style="width: 12%" />
20     <col style="width: 45%" />
21   </colgroup>
22   <thead>
23     <tr>
24       <th>
25         component
26       </th><th>
27         script, version
28       </th><th>
29         progress
30         <%= link_to '(refresh)', request.fullpath, class: 'refresh', remote: true, method: 'get' %>
31       </th><th>
32       </th><th>
33         output
34       </th>
35     </tr>
36   </thead>
37   <tbody>
38     <% render_pipeline_jobs.each do |pj| %>
39     <tr>
40       <td>
41         <% job_status = render(partial: 'job_status_label', 
42                                locals: { :j => pj[:job], :title => pj[:name] }) %>
43         <% if pj[:job].andand[:uuid] %>
44           <%= link_to(job_status, job_url(id: pj[:job][:uuid])) %>
45         <% else %>
46           <%= job_status %>
47         <% end %>
48       </td><td>
49         <%= pj[:script] %>
50         <br /><span class="deemphasize"><%= pj[:script_version] %></span>
51       </td><td>
52         <%= pj[:progress_bar] %>
53       </td><td>
54         <%= render(partial: 'job_status_label', 
55                                locals: { :j => pj[:job] }) %>
56       </td><td>
57         <%= link_to_if_arvados_object pj[:output] %>
58       </td>
59     </tr>
60     <% end %>
61   </tbody>
62   <tfoot>
63     <tr><td colspan="5"></td></tr>
64   </tfoot>
65 </table>
66
67 <% if @object.active %>
68 <% content_for :js do %>
69 setInterval(function(){$('a.refresh').click()}, 15000);
70 <% end %>
71 <% end %>
72
73 <% else %>
74
75   <p>Please set the desired input parameters for the components of this pipeline.  Parameters highlighted in red are required.</p>
76
77   <% content_for :tab_line_buttons do %>
78     <%= form_tag @object, :method => :put do |f| %>
79       
80       <%= hidden_field @object.class.to_s.underscore.singularize.to_sym, :active, :value => true %>
81
82       <%= button_tag "Run pipeline", {class: 'btn btn-primary pull-right', id: "run-pipeline-button"} %>
83     <% end %>
84   <% end %>
85
86   <%= render partial: 'pipeline_templates/show_components_template', locals: {:template => template, :obj => @object} %>
87   
88 <% end %>