[ARVADOS] updated: 4bc4165ea8acbcfb2c1a19e0793a52c48d04cc59

git at public.curoverse.com git at public.curoverse.com
Tue Feb 4 05:55:17 EST 2014


Summary of changes:
 .../app/controllers/application_controller.rb      |    3 -
 .../app/controllers/authorized_keys_controller.rb  |    2 +-
 .../app/controllers/collections_controller.rb      |    3 +
 .../app/controllers/repositories_controller.rb     |    3 +
 .../app/controllers/virtual_machines_controller.rb |    3 +
 .../app/helpers/authorized_keys_helper.rb          |    3 -
 apps/workbench/app/helpers/repositories_helper.rb  |    3 -
 .../app/helpers/virtual_machines_helper.rb         |    3 -
 .../views/application/_show_attributes.html.erb    |    1 +
 .../workbench/app/views/application/index.html.erb |    6 +-
 apps/workbench/app/views/application/show.html.erb |   22 ++++-
 .../app/views/collections/_show_files.html.erb     |   34 ++++++++
 .../app/views/collections/_show_jobs.html.erb      |   64 +++++++++++++++
 .../views/collections/_show_provenance.html.erb    |   84 ++++++++++++++++++++
 .../collections/_show_provenance_graph.html.erb    |    9 ++
 .../views/collections/_show_source_data.html.erb   |   44 ++++++++++
 .../app/views/layouts/application.html.erb         |    2 +-
 17 files changed, 270 insertions(+), 19 deletions(-)
 create mode 100644 apps/workbench/app/views/application/_show_attributes.html.erb
 create mode 100644 apps/workbench/app/views/collections/_show_files.html.erb
 create mode 100644 apps/workbench/app/views/collections/_show_jobs.html.erb
 create mode 100644 apps/workbench/app/views/collections/_show_provenance.html.erb
 create mode 100644 apps/workbench/app/views/collections/_show_provenance_graph.html.erb
 create mode 100644 apps/workbench/app/views/collections/_show_source_data.html.erb

       via  4bc4165ea8acbcfb2c1a19e0793a52c48d04cc59 (commit)
       via  7e44e7ea12b604b8823c24f468c33e9f33fb6e5f (commit)
      from  f1d8f4de37ff66b21330ffe500c9725620ec9614 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 4bc4165ea8acbcfb2c1a19e0793a52c48d04cc59
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Feb 4 02:54:23 2014 -0800

    Move show-object content into tabs.
    
    refs #1979

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 8d6d494..3f495ca 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -54,9 +54,6 @@ class ApplicationController < ActionController::Base
     self.render_error status: 404
   end
 
-  def helper
-    (self.class.to_s.sub(/Controller$/,'')+'Helper').constantize
-  end
   def index
     @objects ||= model_class.limit(1000).all
     respond_to do |f|
diff --git a/apps/workbench/app/controllers/authorized_keys_controller.rb b/apps/workbench/app/controllers/authorized_keys_controller.rb
index 2e3d8b1..4cd5280 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 setup)
+    %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 62e513d..7feba20 100644
--- a/apps/workbench/app/controllers/collections_controller.rb
+++ b/apps/workbench/app/controllers/collections_controller.rb
@@ -2,6 +2,9 @@ class CollectionsController < ApplicationController
   skip_before_filter :find_object_by_uuid, :only => [:provenance]
   skip_before_filter :check_user_agreements, :only => [:show_file]
 
+  def show_pane_list
+    %w(files attributes provenance provenance_graph)
+  end
   def index
     if params[:search].andand.length.andand > 0
       tags = Link.where(any: ['contains', params[:search]])
diff --git a/apps/workbench/app/controllers/repositories_controller.rb b/apps/workbench/app/controllers/repositories_controller.rb
index d710bd6..b6b3295 100644
--- a/apps/workbench/app/controllers/repositories_controller.rb
+++ b/apps/workbench/app/controllers/repositories_controller.rb
@@ -1,2 +1,5 @@
 class RepositoriesController < ApplicationController
+  def index_pane_list
+    %w(recent help)
+  end
 end
diff --git a/apps/workbench/app/controllers/virtual_machines_controller.rb b/apps/workbench/app/controllers/virtual_machines_controller.rb
index a62ba81..c3512e2 100644
--- a/apps/workbench/app/controllers/virtual_machines_controller.rb
+++ b/apps/workbench/app/controllers/virtual_machines_controller.rb
@@ -1,4 +1,7 @@
 class VirtualMachinesController < ApplicationController
+  def index_pane_list
+    %w(recent help)
+  end
   def index
     @objects ||= model_class.all
     @vm_logins = {}
diff --git a/apps/workbench/app/helpers/authorized_keys_helper.rb b/apps/workbench/app/helpers/authorized_keys_helper.rb
index 1ea45c1..9a486f2 100644
--- a/apps/workbench/app/helpers/authorized_keys_helper.rb
+++ b/apps/workbench/app/helpers/authorized_keys_helper.rb
@@ -1,5 +1,2 @@
 module AuthorizedKeysHelper
-  def index_pane_list
-    %w(recent help)
-  end
 end
diff --git a/apps/workbench/app/helpers/repositories_helper.rb b/apps/workbench/app/helpers/repositories_helper.rb
index c8d1590..2860b5a 100644
--- a/apps/workbench/app/helpers/repositories_helper.rb
+++ b/apps/workbench/app/helpers/repositories_helper.rb
@@ -1,5 +1,2 @@
 module RepositoriesHelper
-  def index_pane_list
-    %w(recent help)
-  end
 end
diff --git a/apps/workbench/app/helpers/virtual_machines_helper.rb b/apps/workbench/app/helpers/virtual_machines_helper.rb
index 69a3e21..cbb398d 100644
--- a/apps/workbench/app/helpers/virtual_machines_helper.rb
+++ b/apps/workbench/app/helpers/virtual_machines_helper.rb
@@ -1,5 +1,2 @@
 module VirtualMachinesHelper
-  def index_pane_list
-    %w(recent help)
-  end
 end
diff --git a/apps/workbench/app/views/application/_show_attributes.html.erb b/apps/workbench/app/views/application/_show_attributes.html.erb
new file mode 100644
index 0000000..0e8d2a2
--- /dev/null
+++ b/apps/workbench/app/views/application/_show_attributes.html.erb
@@ -0,0 +1 @@
+<%= render partial: 'arvados_object' %>
diff --git a/apps/workbench/app/views/application/index.html.erb b/apps/workbench/app/views/application/index.html.erb
index e3dde58..95e0b41 100644
--- a/apps/workbench/app/views/application/index.html.erb
+++ b/apps/workbench/app/views/application/index.html.erb
@@ -12,7 +12,7 @@
  
 <% end rescue nil %>
 
-<% pane_list = (controller.class.to_s.sub(/Controller$/,'')+'Helper').constantize.index_pane_list rescue %w(recent) %>
+<% pane_list = controller.index_pane_list rescue %w(recent) %>
 
 <div class="tabbable">
 <ul class="nav nav-tabs">
diff --git a/apps/workbench/app/views/application/show.html.erb b/apps/workbench/app/views/application/show.html.erb
index f304699..348d9d9 100644
--- a/apps/workbench/app/views/application/show.html.erb
+++ b/apps/workbench/app/views/application/show.html.erb
@@ -21,5 +21,19 @@
 <% end %>
 <% end %>
 
+<% pane_list = controller.show_pane_list rescue %w(attributes) %>
 
-<%= render :partial => 'application/arvados_object' %>
+<div class="tabbable">
+<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"><%= pane.capitalize.gsub '_', ' ' %></a></li>
+  <% end %>
+</ul>
+
+<div class="tab-content">
+  <% pane_list.each_with_index do |pane, i| %>
+  <div id="<%= pane %>" class="tab-pane fade in <%= 'active' if i==0 %>">
+    <%= render partial: 'show_' + pane %>
+  </div>
+  <% end %>
+</div>
diff --git a/apps/workbench/app/views/collections/_show_files.html.erb b/apps/workbench/app/views/collections/_show_files.html.erb
new file mode 100644
index 0000000..3973800
--- /dev/null
+++ b/apps/workbench/app/views/collections/_show_files.html.erb
@@ -0,0 +1,34 @@
+<table class="table table-bordered" style="table-layout: fixed">
+  <thead>
+    <tr>
+      <th>path</th>
+      <th>file</th>
+      <th style="width:1.5em">d/l</th>
+      <th style="width: 7em; text-align:right">size</th>
+    </tr>
+  </thead><tbody>
+    <% if @object then @object.files.sort_by{|f|f[1]}.each do |file| %>
+    <% file_path = "#{file[0]}/#{file[1]}" %>
+    <tr>
+      <td>
+        <%= file[0] %>
+      </td>
+
+      <td>
+        <%= 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="icon-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>
+
+    </tr>
+    <% end; end %>
+  </tbody>
+</table>
diff --git a/apps/workbench/app/views/collections/_show_jobs.html.erb b/apps/workbench/app/views/collections/_show_jobs.html.erb
new file mode 100644
index 0000000..98fd199
--- /dev/null
+++ b/apps/workbench/app/views/collections/_show_jobs.html.erb
@@ -0,0 +1,64 @@
+<table class="topalign table table-bordered">
+  <thead>
+    <tr class="contain-align-left">
+      <th>
+	job
+      </th><th>
+	version
+      </th><th>
+	status
+      </th><th>
+	start
+      </th><th>
+	finish
+      </th><th>
+	clock time
+      </th>
+    </tr>
+  </thead>
+  <tbody>
+
+    <% @provenance.reverse.each do |p| %>
+    <% j = p[:job] %>
+
+    <% if j %>
+
+    <tr class="job">
+      <td>
+	<tt><%= j.uuid %></tt>
+	<br />
+	<tt class="deemphasize"><%= j.submit_id %></tt>
+      </td><td>
+	<%= j.script_version %>
+      </td><td>
+        <span class="label <%= if j.success then 'label-success'; elsif j.running then 'label-primary'; else 'label-warning'; end %>">
+	  <%= j.success || j.running ? 'ok' : 'failed' %>
+        </span>
+      </td><td>
+	<%= j.started_at %>
+      </td><td>
+	<%= j.finished_at %>
+      </td><td>
+	<% if j.started_at and j.finished_at %>
+	<%= raw(distance_of_time_in_words(j.started_at, j.finished_at).sub('about ','~').sub(' ',' ')) %>
+	<% elsif j.started_at and j.running %>
+	<%= raw(distance_of_time_in_words(j.started_at, Time.now).sub('about ','~').sub(' ',' ')) %> (running)
+	<% end %>
+      </td>
+    </tr>
+
+    <% else %>
+    <tr>
+      <td>
+	<span class="label label-danger">lookup fail</span>
+	<br />
+	<tt class="deemphasize"><%= p[:target] %></tt>
+      </td><td colspan="4">
+      </td>
+    </tr>
+    <% end %>
+
+    <% end %>
+
+  </tbody>
+</table>
diff --git a/apps/workbench/app/views/collections/_show_provenance.html.erb b/apps/workbench/app/views/collections/_show_provenance.html.erb
new file mode 100644
index 0000000..bd96238
--- /dev/null
+++ b/apps/workbench/app/views/collections/_show_provenance.html.erb
@@ -0,0 +1,84 @@
+<%= content_for :css do %>
+<%# https://github.com/mbostock/d3/wiki/Ordinal-Scales %>
+<% n=-1; %w(#1f77b4 #ff7f0e #2ca02c #d62728 #9467bd #8c564b #e377c2 #7f7f7f #bcbd22 #17becf).each do |color| %>
+.colorseries-10-<%= n += 1 %>, .btn.colorseries-10-<%= n %>:hover, .label.colorseries-10-<%= n %>:hover {
+  *background-color: <%= color %>;
+  background-color: <%= color %>;
+  background-image: none;
+}
+<% end %>
+.colorseries-nil { }
+.label a {
+  color: inherit;
+}
+<% end %>
+
+<table class="topalign table table-bordered">
+  <thead>
+  </thead>
+  <tbody>
+
+    <% @provenance.reverse.each do |p| %>
+    <% j = p[:job] %>
+
+    <% if j %>
+
+    <tr class="job">
+      <td style="padding-bottom: 3em">
+        <table class="table" style="margin-bottom: 0; background: #f0f0ff">
+	  <% j.script_parameters.each do |k,v| %>
+          <tr>
+            <td style="width: 20%">
+              <%= k.to_s %>
+            </td><td style="width: 60%">
+	      <% if v and @output2job.has_key? v %>
+	      <tt class="label colorseries-10-<%= @output2colorindex[v] %>"><%= link_to_if_arvados_object v %></tt>
+              <% else %>
+	      <span class="deemphasize"><%= link_to_if_arvados_object v %></span>
+              <% end %>
+            </td><td style="text-align: center; width: 20%">
+              <% if v
+                 if @protected[v]
+                 labelclass = 'success'
+                 labeltext = 'keep'
+                 else
+                 labelclass = @output2job.has_key?(v) ? 'warning' : 'danger'
+                 labeltext = 'cache'
+                 end %>
+
+	      <tt class="label label-<%= labelclass %>"><%= labeltext %></tt>
+              <% end %>
+            </td>
+          </tr>
+	  <% end %>
+        </table>
+        <div style="text-align: center">
+          ↓
+          <br />
+	  <span class="label"><%= j.script %><br /><tt><%= link_to_if j.script_version.match(/[0-9a-f]{40}/), j.script_version, "https://arvados.org/projects/arvados/repository/revisions/#{j.script_version}/entry/crunch_scripts/#{j.script}" if j.script_version %></tt></span>
+          <br />
+          ↓
+          <br />
+	  <tt class="label colorseries-10-<%= @output2colorindex[p[:output]] %>"><%= link_to_if_arvados_object p[:output] %></tt>
+        </div>
+      </td>
+      <td>
+	<tt><span class="deemphasize">job:</span><br /><%= link_to_if_arvados_object j %><br /><span class="deemphasize"><%= j.submit_id %></span></tt>
+      </td>
+    </tr>
+
+    <% else %>
+    <tr>
+      <td>
+	<span class="label label-danger">lookup fail</span>
+	<br />
+	<tt class="deemphasize"><%= p[:target] %></tt>
+      </td><td colspan="5">
+      </td>
+    </tr>
+    <% end %>
+
+    <% end %>
+
+  </tbody>
+</table>
diff --git a/apps/workbench/app/views/collections/_show_provenance_graph.html.erb b/apps/workbench/app/views/collections/_show_provenance_graph.html.erb
new file mode 100644
index 0000000..1f367c7
--- /dev/null
+++ b/apps/workbench/app/views/collections/_show_provenance_graph.html.erb
@@ -0,0 +1,9 @@
+<% content_for :js do %>
+    $(function() {
+      $('#prov-tab').on('shown', function() { provenance_sizing_fixup("provenance_graph", "provenance_svg"); });
+    })
+<% end %>
+<%= render partial: 'application/svg_div', locals: {
+    divId: "provenance_graph", 
+    svgId: "provenance_svg", 
+    svg: @prov_svg } %>
diff --git a/apps/workbench/app/views/collections/_show_source_data.html.erb b/apps/workbench/app/views/collections/_show_source_data.html.erb
new file mode 100644
index 0000000..cb96f08
--- /dev/null
+++ b/apps/workbench/app/views/collections/_show_source_data.html.erb
@@ -0,0 +1,44 @@
+<table class="table table-bordered table-striped">
+  <thead>
+    <tr class="contain-align-left">
+      <th>
+	collection
+      </th><th class="data-size">
+	data size
+      </th><th>
+	storage
+      </th><th>
+	origin
+      </th>
+    </tr>
+  </thead>
+  <tbody>
+
+    <% @sourcedata.values.each do |sourcedata| %>
+
+    <tr class="collection">
+      <td>
+	<tt class="label"><%= sourcedata[:uuid] %></tt>
+      </td><td class="data-size">
+	<%= raw(human_readable_bytes_html(sourcedata[:collection].data_size)) if sourcedata[:collection] and sourcedata[:collection].data_size %>
+      </td><td>
+	<% if @protected[sourcedata[:uuid]] %>
+	<span class="label label-success">keep</span>
+	<% else %>
+	<span class="label label-danger">cache</span>
+	<% end %>
+      </td><td>
+	<% if sourcedata[:data_origins] %>
+	<% sourcedata[:data_origins].each do |data_origin| %>
+	<span class="deemphasize"><%= data_origin[0] %></span>
+	<%= data_origin[2] %>
+	<br />
+	<% end %>
+	<% end %>
+      </td>
+    </tr>
+
+    <% end %>
+
+  </tbody>
+</table>

commit 7e44e7ea12b604b8823c24f468c33e9f33fb6e5f
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Feb 4 02:31:51 2014 -0800

    Use object type or friendly_link_name as browser title.
    
    refs #1979

diff --git a/apps/workbench/app/views/application/index.html.erb b/apps/workbench/app/views/application/index.html.erb
index 99cf64f..e3dde58 100644
--- a/apps/workbench/app/views/application/index.html.erb
+++ b/apps/workbench/app/views/application/index.html.erb
@@ -1,3 +1,7 @@
+<% content_for :page_title do %>
+<%= controller.model_class.to_s.pluralize.underscore.capitalize.gsub '_', ' ' %>
+<% end %>
+
 <% if controller.model_class.creatable? %>
 <%= button_to "Add a new #{controller.model_class.to_s.underscore.gsub '_', ' '}", 
     { action: 'create', return_to: request.url }, 
diff --git a/apps/workbench/app/views/application/show.html.erb b/apps/workbench/app/views/application/show.html.erb
index e8a15f3..f304699 100644
--- a/apps/workbench/app/views/application/show.html.erb
+++ b/apps/workbench/app/views/application/show.html.erb
@@ -1,9 +1,9 @@
-<% if @object.respond_to? :properties %>
-
 <% content_for :page_title do %>
-<%= @object.properties[:page_title] || @object.friendly_link_name %>
+<%= (@object.respond_to?(:properties) ? @object.properties[:page_title] : nil) ||
+    @object.friendly_link_name %>
 <% end %>
 
+<% if @object.respond_to? :properties %>
 <% if @object.properties[:page_content] %>
 <% content_for :page_content do %>
 <h1>
diff --git a/apps/workbench/app/views/layouts/application.html.erb b/apps/workbench/app/views/layouts/application.html.erb
index 4b5ce20..5b1e6b2 100644
--- a/apps/workbench/app/views/layouts/application.html.erb
+++ b/apps/workbench/app/views/layouts/application.html.erb
@@ -4,7 +4,7 @@
   <meta charset="utf-8">
   <title>
     <% if content_for? :page_title %>
-    <%= yield :page_title %>
+    <%= yield :page_title %> @<%= Rails.configuration.site_name %>
     <% else %>
     <%= Rails.configuration.site_name %>
     <% end %>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list