[ARVADOS] updated: 32f6ee6884704bde04878f5cbc176a7a819a50e8

git at public.curoverse.com git at public.curoverse.com
Thu Jun 5 22:02:36 EDT 2014


Summary of changes:
 apps/workbench/app/assets/images/ajax-loader.gif   | Bin 0 -> 3208 bytes
 apps/workbench/app/assets/javascripts/event_log.js |   2 +-
 .../app/assets/javascripts/pipeline_instances.js   |   6 ++--
 .../app/views/application/_content.html.erb        |  34 +++++++++++++++------
 4 files changed, 29 insertions(+), 13 deletions(-)
 create mode 100644 apps/workbench/app/assets/images/ajax-loader.gif

       via  32f6ee6884704bde04878f5cbc176a7a819a50e8 (commit)
      from  38a55a1518838ea68cba69b4e8d1c27d2128328d (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 32f6ee6884704bde04878f5cbc176a7a819a50e8
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Thu Jun 5 22:02:30 2014 -0400

    2961: Now loads tab panes (past the first one) in the background.
    Automatically triggers reload of tab panes when receiving a changed event from
    websocket.

diff --git a/apps/workbench/app/assets/images/ajax-loader.gif b/apps/workbench/app/assets/images/ajax-loader.gif
new file mode 100644
index 0000000..3288d10
Binary files /dev/null and b/apps/workbench/app/assets/images/ajax-loader.gif differ
diff --git a/apps/workbench/app/assets/javascripts/event_log.js b/apps/workbench/app/assets/javascripts/event_log.js
index 6e0a47c..0539021 100644
--- a/apps/workbench/app/assets/javascripts/event_log.js
+++ b/apps/workbench/app/assets/javascripts/event_log.js
@@ -40,7 +40,7 @@ function onEventLogDispatcherMessage(event) {
   object_uuid = parsedData.object_uuid;
 
   // if there are any listeners for this object uuid or "all", trigger the event
-  matches = ".arv-log-event-listener[data-object-uuid=\"" + object_uuid + "\"],.arv-log-event-listener[data-object-uuids~=\"" + object_uuid + "\"],.arv-log-event-listener[data-object-uuid=\"all\"],.arv-log-event-listener[data-object-type=\"" + object_uuid.slice(6, 11) + "\"]";
+  matches = ".arv-log-event-listener[data-object-uuid=\"" + object_uuid + "\"],.arv-log-event-listener[data-object-uuids~=\"" + object_uuid + "\"],.arv-log-event-listener[data-object-uuid=\"all\"],.arv-log-event-listener[data-object-kind=\"" + parsedData.object_kind + "\"]";
   $(matches).trigger('arv-log-event', event.data);
 }
 
diff --git a/apps/workbench/app/assets/javascripts/pipeline_instances.js b/apps/workbench/app/assets/javascripts/pipeline_instances.js
index 794585c..c61e336 100644
--- a/apps/workbench/app/assets/javascripts/pipeline_instances.js
+++ b/apps/workbench/app/assets/javascripts/pipeline_instances.js
@@ -48,11 +48,11 @@ $(document).on('ready ajax:complete', function() {
 });
 
 $(document).on('arv-log-event', '.arv-log-event-handler-append-logs', function(event, eventData){
-  parsedData = JSON.parse(eventData);
+  var parsedData = JSON.parse(eventData);
 
-  propertyText = undefined
+  var propertyText = undefined
 
-  properties = parsedData.properties;
+  var properties = parsedData.properties;
     if (properties !== null) {
       propertyText = properties.text;
     }
diff --git a/apps/workbench/app/views/application/_content.html.erb b/apps/workbench/app/views/application/_content.html.erb
index 8a0624b..4499392 100644
--- a/apps/workbench/app/views/application/_content.html.erb
+++ b/apps/workbench/app/views/application/_content.html.erb
@@ -1,22 +1,38 @@
 <% 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, objects: @objects })]
-   }.compact] %>
 
 <ul class="nav nav-tabs">
-  <% panes.each_with_index do |(pane, content), i| %>
+  <% pane_list.each_with_index do |pane, 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">
-<% panes.each_with_index do |(pane, content), i| %>
-  <div id="<%= pane %>" class="tab-pane fade <%= 'in active' if i==0 %>">
+<% pane_list.each_with_index do |pane, i| %>
+  <div id="<%= pane %>"
+       class="tab-pane fade <%= 'in active' if i==0 %> arv-log-event-listener"
+       data-object-uuid="<%= @object.uuid if @object %>">
+
+<% content_for :js do %>
+  $(document).on('<%= 'ready' if i != 0 %> arv-log-event', function() {
+  $.ajax('<%= url_for @object %>?tab_pane=<%= pane %>', {dataType: 'html', type: 'GET'}).
+  done(function(data, status, jqxhr) {
+    $('#<%= pane %> > div > div').html(data);
+  }).
+  fail(function(jqxhr, status, error) {
+  });
+  });
+<% end %>
+
     <div class="smart-scroll" style="margin-top:0.5em;">
-      <%= content %>
+      <div class="pane-content">
+        <% if i == 0 %>
+          <%= render(partial: 'show_' + pane.downcase,
+                     locals: { comparable: comparable, objects: @objects }) %>
+          <% else %>
+            <%= image_tag 'ajax-loader.gif' %>
+        <% end %>
+      </div>
     </div>
   </div>
 <% end %>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list