-<%= content_for :tab_line_buttons do %>
-<%= form_tag({action: 'compare', controller: params[:controller], method: 'get'}, {method: 'get', id: 'compare', class: 'pull-right small-form-margin'}) do |f| %>
- <%= submit_tag 'Compare 2 or 3 selected', {class: 'btn btn-primary', disabled: true, style: 'display: none'} %>
-
-<% end rescue nil %>
-<% end %>
+<%# Copyright (C) The Arvados Authors. All rights reserved.
+
+SPDX-License-Identifier: AGPL-3.0 %>
-<%= form_tag do |f| %>
+<%= form_tag({}, {id: "comparedInstances"}) do |f| %>
-<table class="table table-condensed table-fixedlayout">
+<table class="table table-condensed table-fixedlayout arv-recent-pipeline-instances">
<colgroup>
<col width="5%" />
- <col width="10%" />
+ <col width="15%" />
+ <col width="25%" />
<col width="20%" />
- <col width="10%" />
- <col width="30%" />
<col width="15%" />
- <col width="10%" />
+ <col width="15%" />
+ <col width="5%" />
</colgroup>
<thead>
<tr class="contain-align-left">
Status
</th><th>
Instance
- </th><th colspan="2">
+ </th><th>
Template
</th><th>
Owner
</th><th>
- Age
+ Created at
+ </th><th>
</th>
</tr>
</thead>
- <tbody>
-
- <% @objects.sort_by { |ob| ob.created_at }.reverse.each do |ob| %>
-
- <tr data-object-uuid="<%= ob.uuid %>">
- <td>
- <%= check_box_tag 'uuids[]', ob.uuid, false, :class => 'persistent-selection' %>
- </td><td>
- <% if ob.success %>
- <span class="label label-success">success</span>
- <% elsif ob.active %>
- <span class="label label-info">active</span>
- <% end %>
- </td><td colspan="2">
- <%= link_to_if_arvados_object ob, friendly_name: true %>
- </td><td>
- <%= link_to_if_arvados_object ob.pipeline_template_uuid, friendly_name: true %>
- </td><td>
- <%= link_to_if_arvados_object ob.owner_uuid, friendly_name: true %>
- </td><td>
- <%= distance_of_time_in_words(ob.created_at, Time.now) %>
- </td>
- </tr>
- <tr>
- <td style="border-top: 0;" colspan="2">
- </td>
- <td style="border-top: 0; opacity: 0.5;" colspan="5">
- <% ob.components.each do |cname, c| %>
- <% status = if !(c.is_a?(Hash) && c[:job].is_a?(Hash))
- nil
- elsif c[:job][:success] == true
- 'success'
- elsif c[:job][:success] == false
- 'danger'
- elsif c[:job][:running] == true
- 'info'
- else
- 'warning'
- end %>
- <span class="label label-<%= status || 'default' %>"><%= cname.to_s %></span>
- <% end %>
- </td>
- </tr>
- <% end %>
+ <tbody data-infinite-scroller="#recent-pipeline-instances" id="recent-pipeline-instances"
+ data-infinite-content-href="<%= url_for partial: :recent_rows %>" >
</tbody>
-</table>
-<% end %>
+</table>
-<% content_for :footer_js do %>
-var showhide_compare = function() {
- var form = $('form#compare')[0];
- $('input[type=hidden][name="uuids[]"]', form).remove();
- $('input[type=submit]', form).prop('disabled',true).show();
- var checked_inputs = $('input[name="uuids[]"]:checked');
- if (checked_inputs.length >= 2 && checked_inputs.length <= 3) {
- checked_inputs.each(function(){
- if(this.checked) {
- $('input[type=submit]', form).prop('disabled',false).show();
- $(form).append($('<input type="hidden" name="uuids[]"/>').val(this.value));
- }
- });
- }
-};
-$('form input[name="uuids[]"]').on('click', showhide_compare);
-showhide_compare();
<% end %>