Checkpoint, working on form to set component inputs.
authorPeter Amstutz <peter.amstutz@curoverse.com>
Tue, 25 Feb 2014 20:26:04 +0000 (15:26 -0500)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Tue, 25 Feb 2014 20:26:04 +0000 (15:26 -0500)
apps/workbench/Gemfile.lock
apps/workbench/app/controllers/pipeline_instances_controller.rb
apps/workbench/app/views/collections/_show_files.html.erb
apps/workbench/app/views/pipeline_instances/_show_components.html.erb

index 247fa30c38437c3fecd61bb3d4608a902eb6b74a..7f4dc8e289150c38165528556f504eb6372dfe4f 100644 (file)
@@ -36,9 +36,6 @@ GEM
     bootstrap-x-editable-rails (1.5.1.1)
       railties (>= 3.0)
     builder (3.0.4)
-    byebug (2.7.0)
-      columnize (~> 0.3)
-      debugger-linecache (~> 1.2)
     capistrano (2.15.5)
       highline
       net-scp (>= 1.0.0)
@@ -52,10 +49,8 @@ GEM
       coffee-script-source
       execjs
     coffee-script-source (1.6.3)
-    columnize (0.3.6)
     commonjs (0.2.7)
     daemon_controller (1.1.7)
-    debugger-linecache (1.2.0)
     erubis (2.7.0)
     execjs (2.0.2)
     highline (1.6.20)
@@ -157,7 +152,6 @@ DEPENDENCIES
   andand
   bootstrap-sass (~> 3.1.0)
   bootstrap-x-editable-rails
-  byebug
   coffee-rails (~> 3.2.0)
   httpclient
   jquery-rails
index 42cb2e9d44c8af1155f56133c7463476013049f5..a8a35b510b4b93fbf6905a5c8cb85602b3bfc7bb 100644 (file)
@@ -45,6 +45,12 @@ class PipelineInstancesController < ApplicationController
   end
 
   def show
+    if @object.components.empty? and @object.pipeline_template_uuid
+      template = PipelineTemplate.find(@object.pipeline_template_uuid)
+      @object.components= template.components
+      @object.save
+    end
+
     @pipelines = [@object]
 
     if params[:compare]
index 53fbad8152608afa2100f055d0dd475cd97d8e00..705ded388a28ba1837c07f84ef9c4324451dfe9e 100644 (file)
@@ -8,6 +8,7 @@
   </colgroup>
   <thead>
     <tr>
+      <th></th>
       <th>path</th>
       <th>file</th>
       <th style="text-align:right">size</th>
index 9597964103c792bc2677771d9344e28fd05ba132..88bed699e18cb803ae13c4c37ffbe75173acbf48 100644 (file)
@@ -3,31 +3,37 @@
     padding-left: 1em;
     padding-right: 1em;
   }
+table.pipeline-components-table {
+  width: 100%;
+  table-layout: fixed;
+}
+
 table.pipeline-components-table thead th {
   text-align: bottom;
 }
 table.pipeline-components-table div.progress {
   margin-bottom: 0;
 }
+
 <% end %>
-<br />
 
+<% if @object.active != nil %>
 <table class="table pipeline-components-table">
   <colgroup>
-    <col width="15%" />
-    <col width="15%" />
-    <col width="35%" />
-    <col width="35%" />
+    <col style="width: 15%" />
+    <col style="width: 35%" />
+    <col style="width: 15%" />
+    <col style="width: 35%" />
   </colgroup>
   <thead>
     <tr>
       <th>
         component
+      </th><th>
+        script, version
       </th><th>
         progress
         <%= link_to '(refresh)', request.fullpath, class: 'refresh', remote: true, method: 'get' %>
-      </th><th>
-        script, version
       </th><th>
         output
       </th>
@@ -42,6 +48,9 @@ table.pipeline-components-table div.progress {
         <% else %>
         <%= pj[:name] %>
         <% end %>
+      </td><td>
+        <%= pj[:script] %>
+        <br /><span class="deemphasize"><%= pj[:script_version] %></span>
       </td><td>
         <%= pj[:progress_bar] %>
         <% if pj[:job].andand[:cancelled_at] %>
@@ -51,9 +60,6 @@ table.pipeline-components-table div.progress {
         <% 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>
@@ -71,4 +77,69 @@ setInterval(function(){$('a.refresh').click()}, 30000);
 <% end %>
 <% end %>
 
-<pre><%= JSON.pretty_generate @object.attributes %></pre>
+<% else %>
+
+  <%= form_tag @object, :method => :put do |f| %>
+
+  <%= hidden_field @object.class.to_s.underscore.singularize.to_sym, :active, :value => true %>
+  <%= button_tag "Run pipeline", {class: 'btn btn-primary pull-right'} %>
+  <% end %>
+
+<table class="table pipeline-components-table" style="margin-top: -.1em">
+  <colgroup>
+    <col style="width: 15%" />
+    <col style="width: 35%" />
+    <col style="width: 15%" />
+    <col style="width: 35%" />
+  </colgroup>
+
+  <thead>
+    <tr>
+      <th>
+        component
+      </th><th>
+        script, version
+      </th><th>
+        parameter
+      </th><th>
+        input
+      </th>
+    </tr>
+  </thead>
+  <tbody>
+  <% @object.components.each do |k, v| %>
+
+    <% sp = v[:script_parameters].collect do |k, v| [k, v] end %>
+
+    <tr>
+      <td><%= k %></td>
+
+      <td><%= v[:script] %>
+        <br /><span class="deemphasize"> <%= v[:script_version] %></span>
+      </td>
+
+      <td>
+        <%= sp[0][0] %>
+      </td>
+
+      <td>
+        <%= sp[0][1] %>
+      </td>
+      </tr>
+
+    <% if sp.length > 1 %>
+    <tr>
+      <td></td>
+      <td></td>
+
+      <% sp[1..-1].each do |p| %>
+        <%= p[0] %>
+        <%= p[1] %>
+      <% end %>
+    </tr>
+  <% end %>
+  <% end %>
+  </tbody>
+  </table>
+  
+<% end %>