[ARVADOS] created: 0f239a0fb11ed7db2fe8db1eaa6ad7216169ac34

git at public.curoverse.com git at public.curoverse.com
Thu Feb 6 20:49:42 EST 2014


        at  0f239a0fb11ed7db2fe8db1eaa6ad7216169ac34 (commit)


commit 0f239a0fb11ed7db2fe8db1eaa6ad7216169ac34
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Feb 6 17:48:33 2014 -0800

    Add section headings to API examples.

diff --git a/apps/workbench/app/views/application/_show_api.html.erb b/apps/workbench/app/views/application/_show_api.html.erb
index df271e0..1781ab4 100644
--- a/apps/workbench/app/views/application/_show_api.html.erb
+++ b/apps/workbench/app/views/application/_show_api.html.erb
@@ -1,5 +1,8 @@
 <% if @object.andand.uuid %>
 
+<div class="panel panel-default">
+  <div class="panel-heading">curl</div>
+  <div class="panel-body">
   <pre>
 curl -X PUT \
  -H "Authorization: OAuth2 $ARVADOS_API_TOKEN" \
@@ -9,7 +12,12 @@ curl -X PUT \
 <%= JSON.pretty_generate({@object.attributes.keys[-3] => @object.attributes.values[-3]}) %>
 EOF
   </pre>
+  </div>
+</div>
 
+<div class="panel panel-default">
+  <div class="panel-heading"><b>arv</b> command line tool</div>
+  <div class="panel-body">
   <pre>
 arv --pretty <%= @object.class.to_s.underscore %> get \
  --uuid <%= @object.uuid %>
@@ -18,10 +26,17 @@ arv <%= @object.class.to_s.underscore %> update \
  --uuid <%= @object.uuid %> \
  --<%= @object.class.to_s.underscore.gsub '_', '-' %> '<%= JSON.generate({@object.attributes.keys[-3] => @object.attributes.values[-3]}).gsub("'","'\''") %>'
       </pre>
+  </div>
+</div>
 
+<div class="panel panel-default">
+  <div class="panel-heading"><b>Python</b> SDK</div>
+  <div class="panel-body">
     <pre>
 import arvados
 
 x = arvados.api().<%= @object.class.to_s.pluralize.underscore %>().get(uuid='<%= @object.uuid %>').execute()
       </pre>
 <% end %>
+  </div>
+</div>

commit ac9a5c429d5a8102151be2d9c9356575494fcf35
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Feb 6 17:48:15 2014 -0800

    Add space under tab row.

diff --git a/apps/workbench/app/views/application/_content.html.erb b/apps/workbench/app/views/application/_content.html.erb
index e702364..3235e7c 100644
--- a/apps/workbench/app/views/application/_content.html.erb
+++ b/apps/workbench/app/views/application/_content.html.erb
@@ -15,7 +15,7 @@
 <div class="tab-content">
 <% panes.each_with_index do |(pane, content), i| %>
   <div id="<%= pane %>" class="tab-pane fade <%= 'in active' if i==0 %>">
-    <div class="smart-scroll">
+    <div class="smart-scroll" style="margin-top:0.5em;">
       <%= content %>
     </div>
   </div>

commit a179c4405895aba6784be3e612c870da1c082f2f
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Feb 6 17:41:54 2014 -0800

    Fix up tab titles.

diff --git a/apps/workbench/app/controllers/api_client_authorizations_controller.rb b/apps/workbench/app/controllers/api_client_authorizations_controller.rb
index 03f0a04..81e324a 100644
--- a/apps/workbench/app/controllers/api_client_authorizations_controller.rb
+++ b/apps/workbench/app/controllers/api_client_authorizations_controller.rb
@@ -7,7 +7,7 @@ class ApiClientAuthorizationsController < ApplicationController
   end
 
   def index_pane_list
-    %w(recent help)
+    %w(Recent Help)
   end
 
 end
diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 100c5ea..d26a13e 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -144,11 +144,11 @@ class ApplicationController < ActionController::Base
   end
 
   def index_pane_list
-    %w(recent)
+    %w(Recent)
   end
 
   def show_pane_list
-    %w(attributes metadata json api)
+    %w(Attributes Metadata JSON API)
   end
 
   protected
diff --git a/apps/workbench/app/controllers/authorized_keys_controller.rb b/apps/workbench/app/controllers/authorized_keys_controller.rb
index 4cd5280..6eaec1e 100644
--- a/apps/workbench/app/controllers/authorized_keys_controller.rb
+++ b/apps/workbench/app/controllers/authorized_keys_controller.rb
@@ -1,6 +1,6 @@
 class AuthorizedKeysController < ApplicationController
   def index_pane_list
-    %w(recent help)
+    %w(Recent Help)
   end
 
   def new
diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb
index d393da0..1fe786d 100644
--- a/apps/workbench/app/controllers/collections_controller.rb
+++ b/apps/workbench/app/controllers/collections_controller.rb
@@ -3,7 +3,7 @@ class CollectionsController < ApplicationController
   skip_before_filter :check_user_agreements, :only => [:show_file]
 
   def show_pane_list
-    %w(files attributes metadata provenance_graph used_by json api)
+    %w(Files Attributes Metadata Provenance_graph Used_by JSON API)
   end
   def index
     if params[:search].andand.length.andand > 0
diff --git a/apps/workbench/app/controllers/jobs_controller.rb b/apps/workbench/app/controllers/jobs_controller.rb
index be9fe03..d302bff 100644
--- a/apps/workbench/app/controllers/jobs_controller.rb
+++ b/apps/workbench/app/controllers/jobs_controller.rb
@@ -33,13 +33,13 @@ class JobsController < ApplicationController
 
   def index_pane_list
     if params[:uuid]
-      %w(recent provenance)
+      %w(Recent Provenance)
     else
-      %w(recent)
+      %w(Recent)
     end
   end
 
   def show_pane_list
-    %w(attributes provenance metadata json api)
+    %w(Attributes Provenance Metadata JSON API)
   end
 end
diff --git a/apps/workbench/app/controllers/pipeline_instances_controller.rb b/apps/workbench/app/controllers/pipeline_instances_controller.rb
index 73668cd..7ca4f6a 100644
--- a/apps/workbench/app/controllers/pipeline_instances_controller.rb
+++ b/apps/workbench/app/controllers/pipeline_instances_controller.rb
@@ -132,11 +132,11 @@ class PipelineInstancesController < ApplicationController
   end
 
   def show_pane_list
-    %w(components graph attributes metadata json api)
+    %w(Components Graph Attributes Metadata JSON API)
   end
 
   def compare_pane_list 
-    %w(text_compare graph)
+    %w(Compare Graph)
   end 
 
   protected
diff --git a/apps/workbench/app/views/application/_content.html.erb b/apps/workbench/app/views/application/_content.html.erb
index 37250cc..e702364 100644
--- a/apps/workbench/app/views/application/_content.html.erb
+++ b/apps/workbench/app/views/application/_content.html.erb
@@ -1,17 +1,22 @@
 <% content_for :tab_panes do %>
 
+<% comparable = controller.respond_to? :compare %>
 <% pane_list ||= %w(recent) %>
+<% panes = Hash[pane_list.map { |pane|
+     [pane, render(partial: 'show_' + pane.downcase,
+                   locals: { comparable: comparable })]
+   }.compact] %>
 
 <ul class="nav nav-tabs">
-  <% pane_list.each_with_index do |pane, i| %>
-    <li class="<%= 'active' if i==0 %>"><a href="#<%= pane %>" data-toggle="tab" id="<%= pane %>-tab"> <%= pane.capitalize.gsub('_', ' ') %></a></li>
+  <% panes.each_with_index do |(pane, content), i| %>
+    <li class="<%= 'active' if i==0 %>"><a href="#<%= pane %>" data-toggle="tab" id="<%= pane %>-tab"> <%= pane.gsub('_', ' ') %></a></li>
   <% end %>
 </ul>
 <div class="tab-content">
-<% pane_list.each_with_index do |pane, i| %>
+<% panes.each_with_index do |(pane, content), i| %>
   <div id="<%= pane %>" class="tab-pane fade <%= 'in active' if i==0 %>">
     <div class="smart-scroll">
-      <%= render partial: 'show_' + pane %>
+      <%= content %>
     </div>
   </div>
 <% end %>

commit 844e35d315e1ac8f2be3af25ed7c930605722704
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Feb 6 17:27:59 2014 -0800

    Fix up collections#index search box with bootstrap3 styles.

diff --git a/apps/workbench/app/views/collections/_show_recent.html.erb b/apps/workbench/app/views/collections/_show_recent.html.erb
index 242f5e5..71b762a 100644
--- a/apps/workbench/app/views/collections/_show_recent.html.erb
+++ b/apps/workbench/app/views/collections/_show_recent.html.erb
@@ -1,9 +1,13 @@
 <% content_for :tab_line_buttons do %>
-<div class="pull-right">
+<div class="pull-right" style="width: 30%">
   <%= form_tag collections_path, method: 'get', remote: true, class: 'form-search' do %>
-  <div class="input-append">
-    <%= text_field_tag :search, params[:search], class: 'search-query' %>
-    <%= submit_tag "Search", name: nil, class: 'btn btn-info' %>
+  <div class="input-group">
+    <%= text_field_tag :search, params[:search], class: 'form-control', placeholder: 'Search collections' %>
+    <span class="input-group-btn">
+      <%= button_tag(class: 'btn btn-info') do %>
+      <span class="glyphicon glyphicon-search"></span>
+      <% end %>
+    </span>
   </div>  
   <% end %>
 </div>

commit 91887bc88de686a11319df6777626b2d6a8775b5
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Feb 6 17:24:33 2014 -0800

    Fix up collections search box on dashboard.

diff --git a/apps/workbench/app/views/users/_tables.html.erb b/apps/workbench/app/views/users/_tables.html.erb
index 37aabe3..b325781 100644
--- a/apps/workbench/app/views/users/_tables.html.erb
+++ b/apps/workbench/app/views/users/_tables.html.erb
@@ -185,13 +185,17 @@
   <strong>Recent collections</strong>
   <%= link_to '(refresh)', request.fullpath, class: 'refresh', remote: true, method: 'get' %>
   <%= link_to raw("Show all collections →"), collections_path, class: 'pull-right' %>
-  <div class="pull-right" style="padding-right: 1em">
+  <div class="pull-right" style="padding-right: 1em; width: 30%;">
     <%= form_tag collections_path,
           method: 'get',
           class: 'form-search small-form-margin' do %>
-    <div class="input-append">
-      <%= text_field_tag :search, params[:search], class: 'search-query search-mini' %>
-      <%= submit_tag "Search", name: nil, class: 'btn btn-mini btn-info' %>
+    <div class="input-group input-group-sm">
+      <%= text_field_tag :search, params[:search], class: 'form-control', placeholder: 'Search' %>
+      <span class="input-group-btn">
+        <%= button_tag(class: 'btn btn-info') do %>
+        <span class="glyphicon glyphicon-search"></span>
+        <% end %>
+      </span>
     </div>  
     <% end %>
   </div>

commit 24c78169caa0db51c32a08db20145d868168728a
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Feb 6 17:08:45 2014 -0800

    Fix up pipeline_instances#index and #compare.

diff --git a/apps/workbench/app/views/pipeline_instances/_show_recent.html.erb b/apps/workbench/app/views/pipeline_instances/_show_recent.html.erb
index e211112..4bae11c 100644
--- a/apps/workbench/app/views/pipeline_instances/_show_recent.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_show_recent.html.erb
@@ -7,27 +7,29 @@
 
 <%= form_tag do |f| %>
 
-<table class="table table-hover">
+<table class="table table-condensed table-fixedlayout">
+  <colgroup>
+    <col width="5%" />
+    <col width="10%" />
+    <col width="20%" />
+    <col width="10%" />
+    <col width="30%" />
+    <col width="15%" />
+    <col width="10%" />
+  </colgroup>
   <thead>
     <tr class="contain-align-left">
       <th>
       </th><th>
-	status
+	Status
       </th><th>
-	id
+	Instance
+      </th><th colspan="2">
+	Template
       </th><th>
-	name
-      </th><th>
-	template
-      </th><th>
-	owner
-      </th><th>
-	components
-      </th><th>
-	dependencies
-      </th><th>
-	created
+	Owner
       </th><th>
+	Age
       </th>
     </tr>
   </thead>
@@ -44,30 +46,34 @@
         <% 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 %>
-      </td><td>
-        <%= ob.name %>
-      </td><td>
-        <%= link_to_if_arvados_object ob.pipeline_template_uuid %>
+        <%= link_to_if_arvados_object ob.pipeline_template_uuid, friendly_name: true %>
       </td><td>
-        <%= link_to_if_arvados_object ob.owner_uuid %>
+        <%= 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="3">
+      </td>
+      <td style="border-top: 0; opacity: 0.5;" colspan="4">
         <% ob.components.each do |cname, c| %>
-        <% status = if !(c.is_a?(Hash) && c[:job].is_a?(Hash)) then nil elsif c[:job][:success] then 'success' elsif c[:job][:running] then 'info' else 'warning' end %>
-        <span class="label <%= "label-#{status}" if status %>"><%= cname.to_s %></span>
+        <% status = if !(c.is_a?(Hash) && c[:job].is_a?(Hash))
+                      nil
+                    elsif c[:job][:success]
+                      'success'
+                    elsif c[:job][:running]
+                      'info'
+                    else
+                      'warning'
+                    end %>
+        <span class="label label-<%= status || 'default' %>"><%= cname.to_s %></span>
         <% end %>
-      </td><td>
-        <small>
-          <% ob.dependencies.each do |d| %>
-          <%= d %><br />
-          <% end %>
-        </small>
-      </td><td>
-        <%= ob.created_at %>
       </td>
     </tr>
-
     <% end %>
 
   </tbody>
diff --git a/apps/workbench/app/views/pipeline_instances/_show_text_compare.html.erb b/apps/workbench/app/views/pipeline_instances/_show_text_compare.html.erb
index dcc88b5..53cd6b3 100644
--- a/apps/workbench/app/views/pipeline_instances/_show_text_compare.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_show_text_compare.html.erb
@@ -11,8 +11,7 @@
 }
 <% end %>
 
-<%# pi_span = [(10.0/[@objects.count,1].max).floor,1].max %>
-<% pi_span = 4 %>
+<% pi_span = [(10.0/[@objects.count,1].max).floor,1].max %>
 
 <div class="headrow">
   <div class="row">
@@ -20,9 +19,10 @@
     <%# label %>
   </div>
   <% @objects.each do |object| %>
-  <div class="col-sm-<%= pi_span %>">
-    <%= render partial: 'application/arvados_attr_value', locals: { obj: object, attr: 'uuid', attrvalue: object.uuid } %>
-    <%= render partial: 'application/arvados_attr_value', locals: { obj: object, attr: 'pipeline_template_uuid', attrvalue: object.pipeline_template_uuid } %>
+  <div class="col-sm-<%= pi_span %>" style="overflow-x: hidden; text-overflow: ellipsis;">
+    <%= link_to_if_arvados_object object, friendly_name: true %>
+    <br />
+    Template: <%= link_to_if_arvados_object object.pipeline_template_uuid, friendly_name: true %>
   </div>
   <% end %>
   </div>
@@ -36,6 +36,7 @@
   <% @objects.each_with_index do |_, x| %>
     <div class="col-sm-<%= pi_span %>">
       <div class="row">
+        <div class="col-sm-12">
 
         <% if row[:components][x] %>
           <% pj = render_pipeline_job row[:components][x] %>
@@ -65,6 +66,7 @@
           <% else %>
           None
         <% end %>
+        </div>
       </div>
     </div>
   <% end %>

commit 6f287d35e8f0b6f78c784de00386af81ba37b95c
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Feb 6 16:41:36 2014 -0800

    Remove extra divider in notifications list.

diff --git a/apps/workbench/app/views/layouts/application.html.erb b/apps/workbench/app/views/layouts/application.html.erb
index 057229b..5cb6c83 100644
--- a/apps/workbench/app/views/layouts/application.html.erb
+++ b/apps/workbench/app/views/layouts/application.html.erb
@@ -134,9 +134,9 @@
           </a>
           <ul class="dropdown-menu" role="menu">
             <% if @notifications.length > 0 %>
-              <% @notifications.each do |n| %>
+              <% @notifications.each_with_index do |n, i| %>
+                <% if i > 0 %><li class="divider"></li><% end %>
                 <li style="padding: 10px"><%= n.call(self) %></li>
-                <li class="divider"></li>
               <% end %>
             <% else %>
               <li style="padding: 10px">No notifications.</li>

commit 979454b25699c04f2b04ab4fe5981ac49c14a6d5
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Feb 6 16:39:48 2014 -0800

    Rearrange thread_with_api_token around_filters so current_user is
    available even when using thread_with_optional_api_token.
    
    This makes notifications show up on users#home when accessed via root
    url.

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 02103c0..100c5ea 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -2,7 +2,8 @@ class ApplicationController < ActionController::Base
   respond_to :html, :json, :js
   protect_from_forgery
   around_filter :thread_clear
-  around_filter :thread_with_api_token, :except => [:render_exception, :render_not_found]
+  around_filter :thread_with_mandatory_api_token, :except => [:render_exception, :render_not_found]
+  around_filter :thread_with_optional_api_token
   before_filter :find_object_by_uuid, :except => [:index, :render_exception, :render_not_found]
   before_filter :check_user_agreements, :except => [:render_exception, :render_not_found]
   before_filter :check_user_notifications, :except => [:render_exception, :render_not_found]
@@ -236,12 +237,25 @@ class ApplicationController < ActionController::Base
     end
   end
 
-  def thread_with_optional_api_token 
-    thread_with_api_token(true) do 
+  def thread_with_mandatory_api_token
+    thread_with_api_token do
       yield
     end
   end
 
+  # This runs after thread_with_mandatory_api_token in the filter chain.
+  def thread_with_optional_api_token
+    if Thread.current[:arvados_api_token]
+      # We are already inside thread_with_mandatory_api_token.
+      yield
+    else
+      # We skipped thread_with_mandatory_api_token. Use the optional version.
+      thread_with_api_token(true) do 
+        yield
+      end
+    end
+  end
+
   def verify_api_token
     begin
       Link.where(uuid: 'just-verifying-my-api-token')
@@ -298,7 +312,7 @@ class ApplicationController < ActionController::Base
   }
 
   @@notification_tests.push lambda { |controller, current_user|
-    AuthorizedKey.limit(1).where(authorized_user_uuid: current_user.uuid).each do   
+    AuthorizedKey.limit(1).where(authorized_user_uuid: current_user.uuid).each do
       return nil
     end
     return lambda { |view|
@@ -307,7 +321,7 @@ class ApplicationController < ActionController::Base
   }
 
   @@notification_tests.push lambda { |controller, current_user|
-    Job.limit(1).where(created_by: current_user.uuid).each do   
+    Job.limit(1).where(created_by: current_user.uuid).each do
       return nil
     end
     return lambda { |view|
@@ -316,7 +330,7 @@ class ApplicationController < ActionController::Base
   }
 
   @@notification_tests.push lambda { |controller, current_user|
-    Collection.limit(1).where(created_by: current_user.uuid).each do   
+    Collection.limit(1).where(created_by: current_user.uuid).each do
       return nil
     end
     return lambda { |view|
@@ -325,7 +339,7 @@ class ApplicationController < ActionController::Base
   }
 
   @@notification_tests.push lambda { |controller, current_user|
-    PipelineInstance.limit(1).where(created_by: current_user.uuid).each do   
+    PipelineInstance.limit(1).where(created_by: current_user.uuid).each do
       return nil
     end
     return lambda { |view|
diff --git a/apps/workbench/app/controllers/sessions_controller.rb b/apps/workbench/app/controllers/sessions_controller.rb
index 7967111..488c67c 100644
--- a/apps/workbench/app/controllers/sessions_controller.rb
+++ b/apps/workbench/app/controllers/sessions_controller.rb
@@ -1,5 +1,6 @@
 class SessionsController < ApplicationController
-  skip_around_filter :thread_with_api_token, :only => [:destroy, :index]
+  skip_around_filter :thread_with_mandatory_api_token, :only => [:destroy, :index]
+  skip_around_filter :thread_with_optional_api_token, :only => [:destroy, :index]
   skip_before_filter :find_object_by_uuid, :only => [:destroy, :index]
   def destroy
     session.clear
diff --git a/apps/workbench/app/controllers/users_controller.rb b/apps/workbench/app/controllers/users_controller.rb
index f0aaae6..3ccaa52 100644
--- a/apps/workbench/app/controllers/users_controller.rb
+++ b/apps/workbench/app/controllers/users_controller.rb
@@ -1,7 +1,6 @@
 class UsersController < ApplicationController
   skip_before_filter :find_object_by_uuid, :only => :welcome
-  skip_around_filter :thread_with_api_token, :only => :welcome
-  around_filter :thread_with_optional_api_token, :only => :welcome
+  skip_around_filter :thread_with_mandatory_api_token, :only => :welcome
 
   def welcome
     if current_user

commit c28ea320f73250c2f68b14086663a59000ba8fe0
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Feb 6 16:12:14 2014 -0800

    Highlight "Dashboard" instead "Users" in left nav when on
    dashboard. Also bring back "System" nav links.

diff --git a/apps/workbench/app/controllers/users_controller.rb b/apps/workbench/app/controllers/users_controller.rb
index 70fa3f6..f0aaae6 100644
--- a/apps/workbench/app/controllers/users_controller.rb
+++ b/apps/workbench/app/controllers/users_controller.rb
@@ -5,6 +5,7 @@ class UsersController < ApplicationController
 
   def welcome
     if current_user
+      params[:action] = 'home'
       home
     end
   end
diff --git a/apps/workbench/app/views/layouts/application.html.erb b/apps/workbench/app/views/layouts/application.html.erb
index fe6ca6b..057229b 100644
--- a/apps/workbench/app/views/layouts/application.html.erb
+++ b/apps/workbench/app/views/layouts/application.html.erb
@@ -170,7 +170,9 @@
         <% if current_user %>
         <div class="well">
         <ul class="arvados-nav">
-          <li><a href="/">Dashboard</a></li>
+          <li class="<%= 'arvados-nav-active' if params[:action] == 'home' %>">
+            <a href="/">Dashboard</a>
+          </li>
           
           <% [['Data', [['humans'],
                         ['traits'],
@@ -181,15 +183,21 @@
                            ['repositories', 'Code repositories'],
                            ['virtual_machines']]],
               ['Activity', [['pipeline_instances', 'Recent pipelines'],
-                            ['jobs', 'Recent jobs']]]].each do |j| %>
+                            ['jobs', 'Recent jobs']]],
+              ['System', [['users'],
+                         ['groups'],
+                         ['nodes', 'Compute nodes'],
+                         ['keep_disks']]]].each do |j| %>   
             <li><%= j[0] %>
               <ul>
               <% j[1].each do |k| %>
-                <li class="<%= 'arvados-nav-active' if params[:controller] == k[0] %>">
-                  <a href="/<%= k[0] %>">
-                    <%= if k[1] then k[1] else k[0].capitalize.gsub('_', ' ') end %>
-                  </a>
-                </li>
+                <% unless k[0] == 'users' and !current_user.andand.is_admin %>
+                  <li class="<%= 'arvados-nav-active' if (params[:controller] == k[0] && params[:action] != 'home') %>">
+                    <a href="/<%= k[0] %>">
+                      <%= if k[1] then k[1] else k[0].capitalize.gsub('_', ' ') end %>
+                    </a>
+                  </li>
+                <% end %>
               <% end %>
               </ul>
             </li>
@@ -203,25 +211,6 @@
               <li><%= link_to 'Admin guide', "#{Rails.configuration.arvados_docsite}/admin", target: "_blank" %></li>
             </ul>
           </li>
-          <% if current_user.andand.is_admin %>
-
-          <% [['Admin', [['users'],
-                         ['groups'],
-                         ['nodes', 'Compute nodes'],
-                         ['keep_disks']]]].each do |j| %>   
-            <li><%= j[0] %>
-              <ul>
-              <% j[1].each do |k| %>
-                <li class="<%= "arvados-nav-active" if params[:controller] == k[0] %>">
-                  <a href="/<%= k[0] %>">
-                    <%= if k[1] then k[1] else k[0].capitalize.gsub('_', ' ') end %>
-                  </a>
-                </li>
-              <% end %>
-              </ul>
-            </li>
-          <% end %>
-          <% end %>
         </ul>
         </div>
         <% end %>

commit d546d0e497737afabce75847a461e6c5cc33e0c2
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Feb 6 16:00:47 2014 -0800

    Clean up collections index and show->files tables.

diff --git a/apps/workbench/app/views/application/_show_recent.html.erb b/apps/workbench/app/views/application/_show_recent.html.erb
index 86b6b04..9028c6a 100644
--- a/apps/workbench/app/views/application/_show_recent.html.erb
+++ b/apps/workbench/app/views/application/_show_recent.html.erb
@@ -8,7 +8,7 @@
 
 <% attr_blacklist = ' created_at modified_at modified_by_user_uuid modified_by_client_uuid updated_at' %>
 
-<table class="table arv-index">
+<table class="table table-condensed arv-index">
   <thead>
     <tr>
       <% @objects.first.attributes_for_display.each do |attr, attrvalue| %>
diff --git a/apps/workbench/app/views/collections/_index_tbody.html.erb b/apps/workbench/app/views/collections/_index_tbody.html.erb
index b412345..9252886 100644
--- a/apps/workbench/app/views/collections/_index_tbody.html.erb
+++ b/apps/workbench/app/views/collections/_index_tbody.html.erb
@@ -16,7 +16,7 @@
       ⋮
     <% end %>
   </td>
-  <td><%= render partial: 'application/arvados_attr_value', locals: { obj: c, attr: "owner_uuid", attrvalue: c.owner_uuid } %></td>
+  <td><%= link_to_if_arvados_object c.owner_uuid, friendly_name: true %></td>
   <td>
     <%= raw(distance_of_time_in_words(c.created_at, Time.now).sub('about ','~').sub(' ',' ')) if c.created_at %>
   </td>
diff --git a/apps/workbench/app/views/collections/_show_files.html.erb b/apps/workbench/app/views/collections/_show_files.html.erb
index 991c92d..ca694d2 100644
--- a/apps/workbench/app/views/collections/_show_files.html.erb
+++ b/apps/workbench/app/views/collections/_show_files.html.erb
@@ -1,10 +1,16 @@
-<table class="table table-bordered" style="table-layout: fixed">
+<table class="table table-condensed table-fixedlayout">
+  <colgroup>
+    <col width="35%" />
+    <col width="40%" />
+    <col width="15%" />
+    <col width="10%" />
+  </colgroup>
   <thead>
     <tr>
       <th>path</th>
       <th>file</th>
-      <th style="width: 3em">d/l</th>
-      <th style="width: 7em; text-align:right">size</th>
+      <th style="text-align:right">size</th>
+      <th>d/l</th>
     </tr>
   </thead><tbody>
     <% if @object then @object.files.sort_by{|f|f[1]}.each do |file| %>
@@ -18,16 +24,15 @@
         <%= link_to file[1], {controller: 'collections', action: 'show_file', uuid: @object.uuid, file: file_path, size: file[2], disposition: 'inline'}, {title: 'View in browser'} %>
       </td>
 
-      <td>
-        <div style="display:inline-block">
-          <%= link_to raw('<i class="glyphicon glyphicon-download"></i>'), {controller: 'collections', action: 'show_file', uuid: @object.uuid, file: file_path, size: file[2], disposition: 'attachment'}, {class: 'label label-info', title: 'Download'} %>
-        </div>
-      </td>
-
       <td style="text-align:right">
         <%= raw(human_readable_bytes_html(file[2])) %>
       </td>
 
+      <td>
+        <div style="display:inline-block">
+          <%= link_to raw('<i class="glyphicon glyphicon-download-alt"></i>'), {controller: 'collections', action: 'show_file', uuid: @object.uuid, file: file_path, size: file[2], disposition: 'attachment'}, {class: 'btn btn-info btn-sm', title: 'Download'} %>
+        </div>
+      </td>
     </tr>
     <% end; end %>
   </tbody>
diff --git a/apps/workbench/app/views/collections/_show_recent.html.erb b/apps/workbench/app/views/collections/_show_recent.html.erb
index 6194202..242f5e5 100644
--- a/apps/workbench/app/views/collections/_show_recent.html.erb
+++ b/apps/workbench/app/views/collections/_show_recent.html.erb
@@ -11,7 +11,7 @@
 
 <div style="padding-right: 1em">
 
-<table id="collections-index" class="topalign table table-bordered table-condensed table-fixedlayout table-smallcontent">
+<table id="collections-index" class="topalign table table-condensed table-fixedlayout">
   <colgroup>
     <col width="10%" />
     <col width="36%" />

commit 46e45190c8d91db0d37920f23700391ff662a3b0
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Feb 6 15:42:23 2014 -0800

    Use .badge-alert to highlight notification badges.

diff --git a/apps/workbench/app/assets/stylesheets/application.css.scss b/apps/workbench/app/assets/stylesheets/application.css.scss
index 5238dd9..feba5c6 100644
--- a/apps/workbench/app/assets/stylesheets/application.css.scss
+++ b/apps/workbench/app/assets/stylesheets/application.css.scss
@@ -107,7 +107,7 @@ ul.arvados-nav li ul li {
     padding-left: 1em;
 }
 
-.badge {
+.badge.badge-alert {
     background: red;
 }
 
diff --git a/apps/workbench/app/views/layouts/application.html.erb b/apps/workbench/app/views/layouts/application.html.erb
index 570d1d5..fe6ca6b 100644
--- a/apps/workbench/app/views/layouts/application.html.erb
+++ b/apps/workbench/app/views/layouts/application.html.erb
@@ -117,7 +117,7 @@
         <li class="dropdown">
           <a href="#" class="dropdown-toggle" data-toggle="dropdown">
             <span class="glyphicon glyphicon-paperclip"></span>
-            <span class="badge"><%= @selection_count %></span>
+            <span class="badge badge-alert"><%= @selection_count %></span>
             <span class="caret"></span>
           </a>
           <ul class="dropdown-menu" role="menu">
@@ -129,7 +129,7 @@
         <li class="dropdown">
           <a href="#" class="dropdown-toggle" data-toggle="dropdown">
             <span class="glyphicon glyphicon-envelope"></span>
-            <span class="badge"><%= @notification_count %></span>
+            <span class="badge badge-alert"><%= @notification_count %></span>
             <span class="caret"></span>
           </a>
           <ul class="dropdown-menu" role="menu">

commit 69d8b15559aa4b1c7b48c3fa07642b8349aec04b
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Feb 6 15:31:59 2014 -0800

    Remove extra breadcrumb separator in "no breadcrumbs" mode.

diff --git a/apps/workbench/app/views/layouts/application.html.erb b/apps/workbench/app/views/layouts/application.html.erb
index f186fda..570d1d5 100644
--- a/apps/workbench/app/views/layouts/application.html.erb
+++ b/apps/workbench/app/views/layouts/application.html.erb
@@ -72,10 +72,10 @@
       <ul class="nav navbar-nav navbar-left">
         <li><a class="navbar-brand" href="/"><%= Rails.configuration.site_name rescue Rails.application.class.parent_name %></a></li>
         <% if current_user %>
-        <li class="nav-separator"><span class="glyphicon glyphicon-arrow-right"></span></li>
         <% if content_for?(:breadcrumbs) %>
           <%= yield(:breadcrumbs) %>
         <% else %>
+          <li class="nav-separator"><span class="glyphicon glyphicon-arrow-right"></span></li>
           <li>
             <%= link_to(
                         controller.model_class.to_s.pluralize.underscore.gsub('_', ' '),

commit 5ae1a381af7d00af67b61626a16b62138b247a97
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Feb 6 15:25:43 2014 -0800

    Expand graph border to tab pane width.

diff --git a/apps/workbench/app/views/application/_svg_div.html.erb b/apps/workbench/app/views/application/_svg_div.html.erb
index 9f5f330..6b3f959 100644
--- a/apps/workbench/app/views/application/_svg_div.html.erb
+++ b/apps/workbench/app/views/application/_svg_div.html.erb
@@ -8,6 +8,7 @@
  border-color: gray;
  position: absolute;
  left: 1px;
+ right: 1px;
 }
 path:hover {
 stroke-width: 5;

commit 6966fd9cc6e2095e3d746c250acb4becac7b7f52
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Feb 6 15:25:17 2014 -0800

    Fix progress bars on pipeline_instances#show

diff --git a/apps/workbench/app/helpers/pipeline_instances_helper.rb b/apps/workbench/app/helpers/pipeline_instances_helper.rb
index dc1326b..3480046 100644
--- a/apps/workbench/app/helpers/pipeline_instances_helper.rb
+++ b/apps/workbench/app/helpers/pipeline_instances_helper.rb
@@ -43,9 +43,9 @@ module PipelineInstancesHelper
 
   def render_pipeline_job pj
     if pj[:percent_done]
-      pj[:progress_bar] = raw("<div class=\"progress\" style=\"width:100px\"><div class=\"bar bar-success\" style=\"width:#{pj[:percent_done]}%\"></div><div class=\"bar\" style=\"width:#{pj[:percent_running]}%\"></div></div>")
+      pj[:progress_bar] = raw("<div class=\"progress\" style=\"width:100px\"><span class=\"progress-bar progress-bar-success\" style=\"width:#{pj[:percent_done]}%\"></span><span class=\"progress-bar\" style=\"width:#{pj[:percent_running]}%\"></span></div>")
     elsif pj[:progress]
-      raw("<div class=\"progress\" style=\"width:100px\"><div class=\"bar\" style=\"width:#{pj[:progress]*100}%\"></div></div>")
+      raw("<div class=\"progress\" style=\"width:100px\"><span class=\"progress-bar\" style=\"width:#{pj[:progress]*100}%\"></span></div>")
     end
     pj[:output_link] = link_to_if_arvados_object pj[:output]
     pj[:job_link] = link_to_if_arvados_object pj[:job][:uuid]

commit 4294d04bb1a79fed6c0d0adf812b6e9918722a2a
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Feb 6 15:19:38 2014 -0800

    Fix up job/pipeline progress bars on dashboard.

diff --git a/apps/workbench/app/views/users/_tables.html.erb b/apps/workbench/app/views/users/_tables.html.erb
index ef7d4a8..37aabe3 100644
--- a/apps/workbench/app/views/users/_tables.html.erb
+++ b/apps/workbench/app/views/users/_tables.html.erb
@@ -7,13 +7,13 @@
       <p>(None)</p>
     <% else %>
       <table class="table table-bordered table-condensed table-fixedlayout">
-	<colgroup>
-          <col width="28%" />
-          <col width="38%" />
-          <col width="7%" />
-          <col width="15%" />
-          <col width="12%" />
-	</colgroup>
+        <colgroup>
+          <col width="20%" />
+          <col width="20%" />
+          <col width="20%" />
+          <col width="13%" />
+          <col width="27%" />
+        </colgroup>
 
         <tr>
 	  <th>Script</th>
@@ -71,15 +71,26 @@
     <span class="label label-success">finished</span>
   <% elsif j.success == false %>
     <span class="label label-danger">failed</span>
-  <% elsif j.running and j.started_at and not j.finished_at %>
-    <% percent_total_tasks = 100 / (j.tasks_summary[:running] + j.tasks_summary[:done] + j.tasks_summary[:todo]) rescue 0 %>
-    <div class="progress">
-      <div class="bar bar-success" style="width: <%= j.tasks_summary[:done] * percent_total_tasks rescue 0 %>%;"></div>
-      <div class="bar" style="width: <%= j.tasks_summary[:running] * percent_total_tasks rescue 0 %>%; opacity: 0.3"></div>
-    </div>
+  <% elsif j.finished_at %>
+    <span class="label">finished?</span>
+  <% elsif j.started_at %>
+    <span class="label label-success">running</span>
   <% else %>
     <span class="label">queued</span>
   <% end %>
+  <% percent_total_tasks = 100 / (j.tasks_summary[:running] + j.tasks_summary[:done] + j.tasks_summary[:todo]) rescue 0 %>
+  <div class="inline-progress-container pull-right">
+    <div class="progress">
+      <span class="progress-bar progress-bar-success" style="width: <%= j.tasks_summary[:done] * percent_total_tasks rescue 0 %>%;">
+      </span>
+      <span class="progress-bar" style="width: <%= j.tasks_summary[:running] * percent_total_tasks rescue 0 %>%;">
+      </span>
+      <% if j.success == false %>
+      <span class="progress-bar progress-bar-danger" style="width: <%= tasks_summary[:failed] * percent_total_tasks rescue 0 %>%;">
+      </span>
+      <% end %>
+    </div>
+  </div>
 </td>
 
 </tr>
@@ -147,18 +158,18 @@
             <% summary = pipeline_summary p %>
             <div class="inline-progress-container pull-right">
               <div class="progress">
-                <div class="bar bar-success" style="width: <%= summary[:percent_done] %>%;">
-                </div>
+                <span class="progress-bar progress-bar-success" style="width: <%= summary[:percent_done] %>%;">
+                </span>
                 <% if p.success == false %>
-                <div class="bar bar-danger" style="width: <%= 100.0 - summary[:percent_done] %>%;">
-                </div>
+                <span class="progress-bar progress-bar-danger" style="width: <%= 100.0 - summary[:percent_done] %>%;">
+                </span>
                 <% else %>
-                <div class="bar" style="width: <%= summary[:percent_running] %>%;">
-                </div>
-                <div class="bar bar-info" style="width: <%= summary[:percent_queued] %>%;">
-                </div>
-                <div class="bar bar-danger" style="width: <%= summary[:percent_failed] %>%;">
-                </div>
+                <span class="progress-bar" style="width: <%= summary[:percent_running] %>%;">
+                </span>
+                <span class="progress-bar progress-bar-info" style="width: <%= summary[:percent_queued] %>%;">
+                </span>
+                <span class="progress-bar progress-bar-danger" style="width: <%= summary[:percent_failed] %>%;">
+                </span>
                 <% end %>
               </div>
             </div>

commit e18a248b859678a41595c497744f8d2d82bb5d89
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Feb 6 11:33:16 2014 -0800

    Add progress bars to pipeline instances table on dashboard.
    
    refs #2006
    
    Conflicts:
    	apps/workbench/app/assets/stylesheets/application.css.scss

diff --git a/apps/workbench/app/assets/stylesheets/application.css.scss b/apps/workbench/app/assets/stylesheets/application.css.scss
index 3265ece..5238dd9 100644
--- a/apps/workbench/app/assets/stylesheets/application.css.scss
+++ b/apps/workbench/app/assets/stylesheets/application.css.scss
@@ -116,7 +116,13 @@ ul.arvados-nav li ul li {
     margin-right: 1em;
     float: left
 }
-
 .smart-scroll {
     overflow: auto;
-}
\ No newline at end of file
+}
+.inline-progress-container div.progress {
+    margin-bottom: 0;
+}
+.inline-progress-container {
+    width: 100px;
+    display:inline-block;
+}
diff --git a/apps/workbench/app/helpers/pipeline_instances_helper.rb b/apps/workbench/app/helpers/pipeline_instances_helper.rb
index 766c1c4..dc1326b 100644
--- a/apps/workbench/app/helpers/pipeline_instances_helper.rb
+++ b/apps/workbench/app/helpers/pipeline_instances_helper.rb
@@ -1,4 +1,31 @@
 module PipelineInstancesHelper
+  def pipeline_summary object=nil
+    object ||= @object
+    ret = {todo:0, running:0, queued:0, done:0, failed:0, total:0}
+    object.components.values.each do |c|
+      ret[:total] += 1
+      case
+      when !c[:job]
+        ret[:todo] += 1
+      when c[:job][:success]
+        ret[:done] += 1
+      when c[:job][:failed]
+        ret[:failed] += 1
+      when c[:job][:finished_at]
+        ret[:running] += 1      # XXX finished but !success and !failed??
+      when c[:job][:started_at]
+        ret[:running] += 1
+      else
+        ret[:queued] += 1
+      end
+    end
+    ret.merge! Hash[ret.collect do |k,v|
+                      [('percent_' + k.to_s).to_sym,
+                       ret[:total]<1 ? 0 : (100.0*v/ret[:total]).floor]
+                    end]
+    ret
+  end
+
   def pipeline_jobs object=nil
     object ||= @object
     if object.components[:steps].is_a? Array
diff --git a/apps/workbench/app/views/pipeline_instances/_show_components.html.erb b/apps/workbench/app/views/pipeline_instances/_show_components.html.erb
index c6f7f9a..9597964 100644
--- a/apps/workbench/app/views/pipeline_instances/_show_components.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_show_components.html.erb
@@ -70,3 +70,5 @@ table.pipeline-components-table div.progress {
 setInterval(function(){$('a.refresh').click()}, 30000);
 <% end %>
 <% end %>
+
+<pre><%= JSON.pretty_generate @object.attributes %></pre>
diff --git a/apps/workbench/app/views/users/_tables.html.erb b/apps/workbench/app/views/users/_tables.html.erb
index bc9ffb6..ef7d4a8 100644
--- a/apps/workbench/app/views/users/_tables.html.erb
+++ b/apps/workbench/app/views/users/_tables.html.erb
@@ -73,7 +73,7 @@
     <span class="label label-danger">failed</span>
   <% elsif j.running and j.started_at and not j.finished_at %>
     <% percent_total_tasks = 100 / (j.tasks_summary[:running] + j.tasks_summary[:done] + j.tasks_summary[:todo]) rescue 0 %>
-    <div class="progress" style="margin-bottom: 0">
+    <div class="progress">
       <div class="bar bar-success" style="width: <%= j.tasks_summary[:done] * percent_total_tasks rescue 0 %>%;"></div>
       <div class="bar" style="width: <%= j.tasks_summary[:running] * percent_total_tasks rescue 0 %>%; opacity: 0.3"></div>
     </div>
@@ -97,13 +97,15 @@
   <% else %>
     <table class="table table-bordered table-condensed table-fixedlayout">
       <colgroup>
-        <col width="73%" />
-        <col width="15%" />
-        <col width="12%" />
+        <col width="30%" />
+        <col width="30%" />
+        <col width="13%" />
+        <col width="27%" />
       </colgroup>
 
       <tr>
-	<th>Pipeline template</th>
+	<th>Instance</th>
+	<th>Template</th>
 	<th>Age</th>
 	<th>Status</th>
       </tr>
@@ -112,9 +114,13 @@
         <tr>
           <td>
             <small>
-	      <% PipelineTemplate.limit(1).where(uuid: p.pipeline_template_uuid).each do |i| %>
-		<%= link_to i.name, pipeline_instance_path(p.uuid) %>
-	      <% end %>
+	      <%= link_to_if_arvados_object p.uuid, friendly_name: true %>
+            </small>
+          </td>
+
+          <td>
+            <small>
+	      <%= link_to_if_arvados_object p.pipeline_template_uuid, friendly_name: true %>
             </small>
           </td>
 
@@ -130,11 +136,32 @@
               <span class="label label-success">finished</span>
             <% elsif p.success == false %>
               <span class="label label-danger">failed</span>
+            <% elsif p.active and p.modified_at < 30.minutes.ago %>
+              <span class="label label-info">stopped</span>
             <% elsif p.active %>
               <span class="label label-info">running</span>
             <% else %>
               <span class="label">queued</span>
             <% end %>
+
+            <% summary = pipeline_summary p %>
+            <div class="inline-progress-container pull-right">
+              <div class="progress">
+                <div class="bar bar-success" style="width: <%= summary[:percent_done] %>%;">
+                </div>
+                <% if p.success == false %>
+                <div class="bar bar-danger" style="width: <%= 100.0 - summary[:percent_done] %>%;">
+                </div>
+                <% else %>
+                <div class="bar" style="width: <%= summary[:percent_running] %>%;">
+                </div>
+                <div class="bar bar-info" style="width: <%= summary[:percent_queued] %>%;">
+                </div>
+                <div class="bar bar-danger" style="width: <%= summary[:percent_failed] %>%;">
+                </div>
+                <% end %>
+              </div>
+            </div>
           </td>
 
         </tr>

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list