Merge branch '4158-fix-compute-node-detail' closes #4158
[arvados.git] / apps / workbench / app / views / pipeline_instances / _running_component.html.erb
index 754629e0481de00354c33be88d56181e9fcedfbf..018d49f5e4a10f5ed9ab81385d8a2416b0b3a0b1 100644 (file)
@@ -39,7 +39,7 @@
           <% if current_job[:state] == "Queued" %>
             <%# column offset 5 %>
             <div class="col-md-6">
-              <% queuetime = Time.now - current_job[:created_at] %>
+              <% queuetime = Time.now - Time.parse(current_job[:created_at].to_s) %>
               Queued for <%= render_runtime(queuetime, true) %>.
               <% begin %>
                 <% if current_job[:queue_position] == 0 %>
@@ -75,8 +75,7 @@
             </div>
           <% end %>
 
-          <% if current_user.is_active %>
-          <% if current_job[:state].in? ["Queued", "Running"] %>
+          <% if current_job[:state].in? ["Queued", "Running"] and @object.editable? %>
             <%# column offset 11 %>
             <div class="col-md-1 pipeline-instance-spacing">
               <%= form_tag "/jobs/#{current_job[:uuid]}/cancel", remote: true, style: "display:inline; padding-left: 1em" do |f| %>
@@ -85,7 +84,6 @@
               <% end %>
             </div>
           <% end %>
-          <% end %>
         <% end %>
       </div>
     </div>