[ARVADOS] updated: f2574ec2e4ddef03c9504cd58741e73426ea1b17

git at public.curoverse.com git at public.curoverse.com
Thu May 15 15:54:42 EDT 2014


Summary of changes:
 apps/workbench/Gemfile                             |  18 ++-
 apps/workbench/Gemfile.lock                        | 147 +++++++++++----------
 .../api_client_authorizations.js.coffee            |   3 -
 .../assets/javascripts/authorized_keys.js.coffee   |   3 -
 apps/workbench/app/assets/javascripts/event_log.js |  34 ++++-
 .../app/assets/javascripts/folders.js.coffee       |   3 -
 .../app/assets/javascripts/groups.js.coffee        |   3 -
 .../app/assets/javascripts/humans.js.coffee        |   3 -
 .../app/assets/javascripts/job_tasks.js.coffee     |   3 -
 .../app/assets/javascripts/jobs.js.coffee          |   3 -
 .../app/assets/javascripts/keep_disks.js.coffee    |   4 -
 .../app/assets/javascripts/links.js.coffee         |   3 -
 .../app/assets/javascripts/logs.js.coffee          |   3 -
 .../app/assets/javascripts/nodes.js.coffee         |   3 -
 .../app/assets/javascripts/pipeline_instances.js   |   1 -
 .../javascripts/pipeline_templates.js.coffee       |   3 -
 .../app/assets/javascripts/repositories.js.coffee  |   3 -
 .../app/assets/javascripts/sessions.js.coffee      |   3 -
 .../app/assets/javascripts/specimens.js.coffee     |   3 -
 .../app/assets/javascripts/traits.js.coffee        |   3 -
 .../assets/javascripts/user_agreements.js.coffee   |   3 -
 .../app/assets/javascripts/users.js.coffee         |   3 -
 .../assets/javascripts/virtual_machines.js.coffee  |   3 -
 .../app/controllers/actions_controller.rb          |   2 +-
 .../app/controllers/application_controller.rb      |   4 +-
 .../app/controllers/collections_controller.rb      |   2 +-
 .../app/controllers/sessions_controller.rb         |   2 +-
 apps/workbench/app/controllers/users_controller.rb |  10 +-
 .../app/helpers/arvados_api_client_helper.rb       |  13 ++
 apps/workbench/app/models/arvados_api_client.rb    |  34 +++--
 apps/workbench/app/models/arvados_base.rb          |  60 ++++++---
 apps/workbench/app/models/arvados_resource_list.rb |   7 +-
 apps/workbench/app/models/collection.rb            |   4 +-
 apps/workbench/app/models/group.rb                 |   4 +-
 apps/workbench/app/models/user.rb                  |  26 ++--
 apps/workbench/app/models/user_agreement.rb        |   8 +-
 .../app/views/layouts/application.html.erb         |   2 +-
 apps/workbench/app/views/links/_recent.html.erb    |   2 +-
 .../pipeline_instances/_show_components.html.erb   |   5 +-
 .../pipeline_instances/_show_event_log.html.erb    |  13 +-
 .../app/views/pipeline_instances/show.js.erb       |   6 +-
 .../workbench/app/views/users/_show_admin.html.erb |   2 +-
 apps/workbench/app/views/users/welcome.html.erb    |   2 +-
 apps/workbench/app/views/websocket/index.html.erb  |   2 +-
 apps/workbench/config/application.default.yml      |  14 +-
 apps/workbench/config/application.rb               |  15 +--
 .../config/environments/development.rb.example     |  12 +-
 .../config/environments/production.rb.example      |   6 +-
 apps/workbench/config/environments/test.rb.example |   6 -
 .../config/initializers/zzz_arvados_api_client.rb  |   8 --
 .../zza_load_config.rb => load_config.rb}          |   0
 apps/workbench/config/routes.rb                    |   8 +-
 apps/workbench/test/integration/users_test.rb      |   7 +-
 apps/workbench/test/test_helper.rb                 |  78 ++++++++---
 .../install-workbench-app.html.textile.liquid      |  11 ++
 services/api/app/models/api_client.rb              |   2 +-
 services/api/app/models/arvados_model.rb           |   6 +-
 services/api/app/models/authorized_key.rb          |   2 +-
 services/api/app/models/collection.rb              |   2 +-
 services/api/app/models/group.rb                   |   5 +-
 services/api/app/models/human.rb                   |   2 +-
 services/api/app/models/job.rb                     |   2 +-
 services/api/app/models/job_task.rb                |   2 +-
 services/api/app/models/keep_disk.rb               |   2 +-
 services/api/app/models/link.rb                    |   2 +-
 services/api/app/models/log.rb                     |   2 +-
 services/api/app/models/node.rb                    |   2 +-
 services/api/app/models/pipeline_instance.rb       |   2 +-
 services/api/app/models/pipeline_template.rb       |   2 +-
 services/api/app/models/repository.rb              |   2 +-
 services/api/app/models/specimen.rb                |   2 +-
 services/api/app/models/trait.rb                   |   2 +-
 services/api/app/models/user.rb                    |   6 +-
 services/api/app/models/virtual_machine.rb         |   2 +-
 services/api/config/initializers/assign_uuid.rb    |   1 -
 services/api/lib/can_be_an_owner.rb                |  47 +++++++
 services/api/lib/{assign_uuid.rb => has_uuid.rb}   |  10 +-
 services/api/test/unit/link_test.rb                |  14 +-
 services/api/test/unit/owner_test.rb               | 126 ++++++++++++++++++
 79 files changed, 566 insertions(+), 314 deletions(-)
 delete mode 100644 apps/workbench/app/assets/javascripts/api_client_authorizations.js.coffee
 delete mode 100644 apps/workbench/app/assets/javascripts/authorized_keys.js.coffee
 delete mode 100644 apps/workbench/app/assets/javascripts/folders.js.coffee
 delete mode 100644 apps/workbench/app/assets/javascripts/groups.js.coffee
 delete mode 100644 apps/workbench/app/assets/javascripts/humans.js.coffee
 delete mode 100644 apps/workbench/app/assets/javascripts/job_tasks.js.coffee
 delete mode 100644 apps/workbench/app/assets/javascripts/jobs.js.coffee
 delete mode 100644 apps/workbench/app/assets/javascripts/links.js.coffee
 delete mode 100644 apps/workbench/app/assets/javascripts/logs.js.coffee
 delete mode 100644 apps/workbench/app/assets/javascripts/nodes.js.coffee
 delete mode 100644 apps/workbench/app/assets/javascripts/pipeline_templates.js.coffee
 delete mode 100644 apps/workbench/app/assets/javascripts/repositories.js.coffee
 delete mode 100644 apps/workbench/app/assets/javascripts/sessions.js.coffee
 delete mode 100644 apps/workbench/app/assets/javascripts/specimens.js.coffee
 delete mode 100644 apps/workbench/app/assets/javascripts/traits.js.coffee
 delete mode 100644 apps/workbench/app/assets/javascripts/user_agreements.js.coffee
 delete mode 100644 apps/workbench/app/assets/javascripts/users.js.coffee
 delete mode 100644 apps/workbench/app/assets/javascripts/virtual_machines.js.coffee
 create mode 100644 apps/workbench/app/helpers/arvados_api_client_helper.rb
 delete mode 100644 apps/workbench/config/initializers/zzz_arvados_api_client.rb
 rename apps/workbench/config/{initializers/zza_load_config.rb => load_config.rb} (100%)
 delete mode 100644 services/api/config/initializers/assign_uuid.rb
 create mode 100644 services/api/lib/can_be_an_owner.rb
 rename services/api/lib/{assign_uuid.rb => has_uuid.rb} (52%)
 create mode 100644 services/api/test/unit/owner_test.rb

       via  f2574ec2e4ddef03c9504cd58741e73426ea1b17 (commit)
       via  e2eca205db4e40de582117790b1e48dbf3e5bf3a (commit)
       via  949c388c5ec3bc4f8cc6b3d503c11dcd20e5bbd4 (commit)
       via  03395937ba05b9e3192e346a355c691f45cc7c85 (commit)
       via  cff5301bbc1e1c8f8421fb56dca5a76dfebb058c (commit)
       via  2d9f17f33a9d8737d97705b8b77e3e1c05f7b411 (commit)
       via  67176a2637ca895015908c7c3bdb1ab7688c1b2c (commit)
       via  a797b27604a0f5a277d73e2d3522dec033fd4ecf (commit)
       via  6ebfb077cbe7357aadccc7ae4f803c61d66d0279 (commit)
       via  a792aabc3159439c66098935fea2da685eee7ed2 (commit)
       via  7ec5dedd6301ae84db941de986f2f0eacc4532e7 (commit)
       via  130bd6ec07cf6844861e49602d33b07dd2402595 (commit)
       via  a46e35694b573fd5c9b355c51323992670fc87b4 (commit)
       via  93842871ab5266e45fb6a29da89462af102a6384 (commit)
       via  85ab544a82c685a74d814a0e10c48624810be0af (commit)
       via  bfa9ee952c1ae3f03fe2f9fa781a132411963030 (commit)
       via  ce5b843c32f6ee74f02a40044073dd4288d16dee (commit)
       via  fba37ca64631be9e0bdfd17ca70d85dd2c896bfa (commit)
       via  ea9592e911a3ccdbbbfeed8812b67e968fe1cc5f (commit)
       via  3dccfa028282d8b667a7b447ea061b7eecc8618f (commit)
       via  fb8dd22df54d0c8f87e97f41e1a1677741a47892 (commit)
       via  96b9b6b0a45ffb1965412fe9a12e23d10260ea8e (commit)
       via  900f179c96733c2ce9140b2d7767f97feb9eaff6 (commit)
       via  fb95d0d2d09c9537f5bdc503e51cf4f091d02c46 (commit)
       via  fadf2b0fe1240f607fc91d65d6831621262afeb1 (commit)
       via  cf32ef421c037692e7ae896f695c61d8e3670f01 (commit)
       via  34ac761cb1fd2b7b9438765d14ded85dfab0453b (commit)
       via  e19b02f69914c086f979ec31eb603bb3b456cd15 (commit)
       via  647c8b8c47ef521046bea7675af84b621c235e0f (commit)
       via  6f6235983d91e0b9fb5660d0a2825f510bbdac73 (commit)
       via  54897c8f978f127a44c0a9d20c1e87cea840b21f (commit)
      from  f5339841222a2ac17d3c04d4e9912c0608041b2f (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 f2574ec2e4ddef03c9504cd58741e73426ea1b17
Merge: e2eca20 949c388
Author: radhika <radhika at curoverse.com>
Date:   Thu May 15 15:54:11 2014 -0400

    Merge branch 'master' into 2756-eventbus-in-workbench


commit e2eca205db4e40de582117790b1e48dbf3e5bf3a
Author: radhika <radhika at curoverse.com>
Date:   Thu May 15 15:52:15 2014 -0400

    2756: store websocket in window to facilitate reuse within page. also, remove elementId from map when leaving page.

diff --git a/apps/workbench/app/assets/javascripts/event_log.js b/apps/workbench/app/assets/javascripts/event_log.js
index c65574f..243f733 100644
--- a/apps/workbench/app/assets/javascripts/event_log.js
+++ b/apps/workbench/app/assets/javascripts/event_log.js
@@ -14,11 +14,21 @@ function subscribeToEventLog (url, uuid, elementId) {
     return;  
   }
 
-  // create the event log dispatcher
-  event_log_disp = new WebSocket(url);
+  // grab websocket connection from window, if one exists
+  event_log_disp = $(window).data("arv-websocket");
+  if (event_log_disp == null) {
+    // create the event log dispatcher
+    event_log_disp = new WebSocket(url);
 
-  event_log_disp.onopen = function(event) { onEventLogDispatcherOpen(event) };
-  event_log_disp.onmessage = function(event) { onEventLogDispatcherMessage(event) };
+    event_log_disp.onopen = function(event) { onEventLogDispatcherOpen(event) };
+    event_log_disp.onmessage = function(event) { onEventLogDispatcherMessage(event) };
+
+    // store websocket in window to allow reuse when multiple divs subscribe for events
+    $(window).data("arv-websocket", event_log_disp);
+
+    // detach elementId when user leaves this window
+    window.onbeforeunload = function (event) {detachElement(event, elementId);}
+  }
 
   // Add the elementId to listener map
   event_log_listener_map = JSON.parse(sessionStorage.getItem("event_log_listener_map"));
@@ -59,3 +69,19 @@ function onEventLogDispatcherMessage(event) {
     }
   }
 }
+
+/**
+ * When leaving this window, remove elementId from map
+ */
+function detachElement(event, elementId) {
+  event_log_listener_map = JSON.parse(sessionStorage.getItem("event_log_listener_map"));
+  if (event_log_listener_map !== null) {
+    delete event_log_listener_map[elementId];
+  }
+
+  // According to documenation, browser will close the connection when page is left.
+  // However, there are suggestions of inconsistency; so to be safe, close explicitly.
+  if (event_log_disp !== null) {
+    event_log_disp.close();
+  }
+}
diff --git a/apps/workbench/app/views/pipeline_instances/_show_event_log.html.erb b/apps/workbench/app/views/pipeline_instances/_show_event_log.html.erb
index f4061f0..c35562b 100644
--- a/apps/workbench/app/views/pipeline_instances/_show_event_log.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_show_event_log.html.erb
@@ -1,5 +1,8 @@
-<span>
-  <h3>Log for pipeline</h3>
-  <image hidden=true id="pipeline_event_log_img" src="/favicon.ico" onclick="sendToDispatcher();" onload="subscribeToEventLog('<%=$arvados_api_client.discovery[:websocketUrl]%>?api_token=<%=Thread.current[:arvados_api_token]%>', '<%=@object.uuid%>', 'pipeline_event_log_area')";></image>
-  <textarea row="10" cols="80" id="pipeline_event_log_area"></textarea>
-</span>
+<% if !@object.state.in? ['Complete', 'Failed'] %>
+  <span>
+    <h3>Log for pipeline</h3>
+    <image hidden=true id="pipeline_event_log_img" src="/favicon.ico" onclick="sendToDispatcher();" onload="subscribeToEventLog('<%=$arvados_api_client.discovery[:websocketUrl]%>?api_token=<%=Thread.current[:arvados_api_token]%>', '<%=@object.uuid%>', 'pipeline_event_log_area')";></image>
+
+    <textarea row="10" cols="80" id="pipeline_event_log_area"></textarea>
+  </span>
+<% end %>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list