pj[:progress] = 0.0
end
end
- if pj[:job]
- if pj[:job][:success]
- pj[:result] = 'complete'
- pj[:complete] = true
- pj[:progress] = 1.0
- elsif pj[:job][:finished_at]
- pj[:result] = 'failed'
- pj[:failed] = true
- elsif pj[:job][:started_at]
- pj[:result] = 'running'
- else
- pj[:result] = 'queued'
- end
+ if pj[:job][:success]
+ pj[:result] = 'complete'
+ pj[:complete] = true
+ pj[:progress] = 1.0
+ elsif pj[:job][:finished_at]
+ pj[:result] = 'failed'
+ pj[:failed] = true
+ elsif pj[:job][:started_at]
+ pj[:result] = 'running'
+ elsif pj[:job][:uuid]
+ pj[:result] = 'queued'
+ else
+ pj[:result] = 'none'
end
pj[:job_id] = pj[:job][:uuid]
- pj[:script] = pj[:job][:script]
- pj[:script_version] = pj[:job][:script_version]
+ pj[:script] = pj[:job][:script] || c[:script]
+ pj[:script_version] = pj[:job][:script_version] || c[:script_version]
pj[:output] = pj[:job][:output]
pj[:finished_at] = (Time.parse(pj[:job][:finished_at]) rescue nil)
ret << pj
-<table class="table table-condensed table-hover topalign">
+<% content_for :css do %>
+table.pipeline-components-table thead th {
+ text-align: bottom;
+}
+table.pipeline-components-table div.progress {
+ margin-bottom: 0;
+}
+<% end %>
+<br />
+
+<table class="table pipeline-components-table">
+ <colgroup>
+ <col width="15%" />
+ <col width="15%" />
+ <col width="35%" />
+ <col width="35%" />
+ </colgroup>
<thead>
+ <tr>
+ <th>
+ component
+ </th><th>
+ progress
+ <%= link_to '(refresh)', request.fullpath, class: 'refresh', remote: true, method: 'get' %>
+ </th><th>
+ script, version
+ </th><th>
+ output
+ </th>
+ </tr>
</thead>
<tbody>
- <% @object.attributes_for_display.each do |attr, attrvalue| %>
- <% if attr == 'components' and attrvalue.is_a? Hash %>
-
- <tr class="info"><td><%= attr %></td><td>
- <table class="table">
- <% render_pipeline_jobs.each do |pj| %>
- <tr><% %w(index name result job_link script script_version progress_detail progress_bar output_link).each do |key| %>
- <td>
- <% if key == 'script_version' %>
- <%= pj[key.to_sym][0..6] rescue '' %>
- <% else %>
- <%= pj[key.to_sym] %>
- <% end %>
- </td>
- <% end %>
- </tr>
- <% end %>
- </table>
- </td></tr>
-
- <% else %>
- <%= render partial: 'application/arvados_object_attr', locals: { attr: attr, attrvalue: attrvalue } %>
- <% end %>
+ <% render_pipeline_jobs.each do |pj| %>
+ <tr>
+ <td>
+ <% if pj[:job].andand[:uuid] %>
+ <%= link_to pj[:name], job_url(id: pj[:job][:uuid]) %>
+ <% else %>
+ <%= pj[:name] %>
+ <% end %>
+ </td><td>
+ <%= pj[:progress_bar] %>
+ <% if pj[:job].andand[:cancelled_at] %>
+ <span class="pull-right label label-warning">cancelled</span>
+ <% elsif pj[:failed] %>
+ <span class="pull-right label label-warning">failed</span>
+ <% elsif pj[:result] == 'queued' %>
+ <span class="pull-right label">queued</span>
+ <% end %>
+ </td><td>
+ <%= pj[:script] %>
+ <br /><span class="deemphasize"><%= pj[:script_version] %></span>
+ </td><td>
+ <%= link_to_if_arvados_object pj[:output] %>
+ </td>
+ </tr>
<% end %>
</tbody>
+ <tfoot>
+ <tr><td colspan="4"></td></tr>
+ </tfoot>
</table>
-<pre>
-<%= JSON.pretty_generate(@object.attributes) rescue nil %>
-</pre>
+
+<div style="height: 1em"></div>
+
+<%= render partial: 'arvados_object' %>
+
+<% if @object.active %>
+<% content_for :js do %>
+setInterval(function(){$('a.refresh').click()}, 30000);
+<% end %>
+<% end %>