[ARVADOS] updated: 0f834e80149820f3300b32072526e6f702493433
git at public.curoverse.com
git at public.curoverse.com
Tue Nov 4 22:55:18 EST 2014
Summary of changes:
apps/workbench/app/assets/javascripts/event_log.js | 70 +++++++++++-----------
apps/workbench/app/assets/javascripts/tab_panes.js | 12 +++-
.../workbench/app/views/jobs/_show_status.html.erb | 2 +-
apps/workbench/app/views/jobs/show.html.erb | 2 +-
.../views/pipeline_instances/_show_log.html.erb | 2 +-
5 files changed, 47 insertions(+), 41 deletions(-)
via 0f834e80149820f3300b32072526e6f702493433 (commit)
via 24d3d682fc97e24ab06e1335953b140b2e49547f (commit)
from 5257d99306e915cc9bb5a65eca81f8517e6e222d (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 0f834e80149820f3300b32072526e6f702493433
Author: Tom Clegg <tom at curoverse.com>
Date: Tue Nov 4 22:54:12 2014 -0500
4084: Skip the "inactive pane" optimization when the div is not a tab pane.
Content divs that are _not_ tabbed panes no longer need to remember to
add an "active" flag.
diff --git a/apps/workbench/app/assets/javascripts/tab_panes.js b/apps/workbench/app/assets/javascripts/tab_panes.js
index 3f1645b..6c58a57 100644
--- a/apps/workbench/app/assets/javascripts/tab_panes.js
+++ b/apps/workbench/app/assets/javascripts/tab_panes.js
@@ -84,9 +84,15 @@ $(document).on('arv:pane:reload', '[data-pane-content-url]', function(e) {
$pane.removeClass('pane-loaded');
$pane.removeClass('pane-stale');
- if (!$pane.hasClass('active')) {
- // When the user selects e.target tab, show a spinner instead of
- // old content while loading.
+ if (!$pane.hasClass('active') &&
+ $pane.parent().hasClass('tab-content')) {
+ // $pane is one of the content areas in a bootstrap tabs
+ // widget, and it isn't the currently selected tab. If and
+ // when the user does select the corresponding tab, it will
+ // get a shown.bs.tab event, which will invoke this reload
+ // function again (see handler above). For now, we just insert
+ // a spinner, which will be displayed while the new content is
+ // loading.
$pane.html('<div class="spinner spinner-32px spinner-h-center"></div>');
return;
}
diff --git a/apps/workbench/app/views/jobs/_show_status.html.erb b/apps/workbench/app/views/jobs/_show_status.html.erb
index 5bb37c3..cfff0da 100644
--- a/apps/workbench/app/views/jobs/_show_status.html.erb
+++ b/apps/workbench/app/views/jobs/_show_status.html.erb
@@ -7,7 +7,7 @@
data-object-uuid="<%= @object.uuid %>"
data-load-throttle="5000"
>
- <div id="job-status-pane" class="active">
+ <div id="job-status-pane">
<%=
pj = {}
pj[:job] = @object
diff --git a/apps/workbench/app/views/jobs/show.html.erb b/apps/workbench/app/views/jobs/show.html.erb
index d83bc72..566014e 100644
--- a/apps/workbench/app/views/jobs/show.html.erb
+++ b/apps/workbench/app/views/jobs/show.html.erb
@@ -1,5 +1,5 @@
<% content_for :tab_line_buttons do %>
- <div class="active pane-loaded arv-log-event-listener arv-refresh-on-state-change"
+ <div class="pane-loaded arv-log-event-listener arv-refresh-on-state-change"
data-pane-content-url="<%= url_for(params.merge(tab_pane: "job_buttons")) %>"
data-object-uuid="<%= @object.uuid %>"
style="display: inline">
diff --git a/apps/workbench/app/views/pipeline_instances/_show_log.html.erb b/apps/workbench/app/views/pipeline_instances/_show_log.html.erb
index 2a71aef..060a669 100644
--- a/apps/workbench/app/views/pipeline_instances/_show_log.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_show_log.html.erb
@@ -1,7 +1,7 @@
<% log_uuids = [@object.uuid] + pipeline_jobs(@object).collect{|x|x[:job].andand[:uuid]}.compact %>
<% log_history = stderr_log_history(log_uuids) %>
<div id="pipeline_event_log_div"
- class="active arv-log-event-listener arv-log-event-handler-append-logs arv-log-event-subscribe-to-pipeline-job-uuids arv-job-log-window"
+ class="arv-log-event-listener arv-log-event-handler-append-logs arv-log-event-subscribe-to-pipeline-job-uuids arv-job-log-window"
data-object-uuids="<%= log_uuids.join(' ') %>"
><%= log_history.join("\n") %></div>
<div class="arv-log-refresh-control"
commit 24d3d682fc97e24ab06e1335953b140b2e49547f
Author: Tom Clegg <tom at curoverse.com>
Date: Tue Nov 4 22:40:48 2014 -0500
4084: Fix up whitespace (4-space indent, like the other *.js)
diff --git a/apps/workbench/app/assets/javascripts/event_log.js b/apps/workbench/app/assets/javascripts/event_log.js
index 8df099a..36361a1 100644
--- a/apps/workbench/app/assets/javascripts/event_log.js
+++ b/apps/workbench/app/assets/javascripts/event_log.js
@@ -4,55 +4,55 @@
/* Subscribe to websockets event log. Do nothing if already connected. */
function subscribeToEventLog () {
- // if websockets are not supported by browser, do not subscribe for events
- websocketsSupported = ('WebSocket' in window);
- if (websocketsSupported == false) {
- return;
- }
-
- // check if websocket connection is already stored on the window
- event_log_disp = $(window).data("arv-websocket");
- if (event_log_disp == null) {
- // need to create new websocket and event log dispatcher
- websocket_url = $('meta[name=arv-websocket-url]').attr("content");
- if (websocket_url == null)
- return;
-
- event_log_disp = new WebSocket(websocket_url);
-
- event_log_disp.onopen = onEventLogDispatcherOpen;
- event_log_disp.onmessage = onEventLogDispatcherMessage;
-
- // store websocket in window to allow reuse when multiple divs subscribe for events
- $(window).data("arv-websocket", event_log_disp);
- }
+ // if websockets are not supported by browser, do not subscribe for events
+ websocketsSupported = ('WebSocket' in window);
+ if (websocketsSupported == false) {
+ return;
+ }
+
+ // check if websocket connection is already stored on the window
+ event_log_disp = $(window).data("arv-websocket");
+ if (event_log_disp == null) {
+ // need to create new websocket and event log dispatcher
+ websocket_url = $('meta[name=arv-websocket-url]').attr("content");
+ if (websocket_url == null)
+ return;
+
+ event_log_disp = new WebSocket(websocket_url);
+
+ event_log_disp.onopen = onEventLogDispatcherOpen;
+ event_log_disp.onmessage = onEventLogDispatcherMessage;
+
+ // store websocket in window to allow reuse when multiple divs subscribe for events
+ $(window).data("arv-websocket", event_log_disp);
+ }
}
/* Send subscribe message to the websockets server. Without any filters
arguments, this subscribes to all events */
function onEventLogDispatcherOpen(event) {
- this.send('{"method":"subscribe"}');
+ this.send('{"method":"subscribe"}');
}
/* Trigger event for all applicable elements waiting for this event */
function onEventLogDispatcherMessage(event) {
- parsedData = JSON.parse(event.data);
- object_uuid = parsedData.object_uuid;
+ parsedData = JSON.parse(event.data);
+ object_uuid = parsedData.object_uuid;
- if (!object_uuid) {
- return;
- }
+ if (!object_uuid) {
+ return;
+ }
- // 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-kind=\"" + parsedData.object_kind + "\"]";
- $(matches).trigger('arv-log-event', parsedData);
+ // 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-kind=\"" + parsedData.object_kind + "\"]";
+ $(matches).trigger('arv-log-event', parsedData);
}
/* Automatically connect if there are any elements on the page that want to
receive event log events. */
$(document).on('ajax:complete ready', function() {
- var a = $('.arv-log-event-listener');
- if (a.length > 0) {
- subscribeToEventLog();
- }
+ var a = $('.arv-log-event-listener');
+ if (a.length > 0) {
+ subscribeToEventLog();
+ }
});
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list