[ARVADOS] updated: e6805dea66e86c6cdad036407f16fe17f45b8f94

git at public.curoverse.com git at public.curoverse.com
Fri May 16 00:26:55 EDT 2014


Summary of changes:
 apps/workbench/app/assets/javascripts/event_log.js | 22 ++++++++--------------
 .../app/assets/javascripts/pipeline_instances.js   | 19 +++++++++++++++++++
 .../pipeline_instances/_show_components.html.erb   |  6 ++----
 3 files changed, 29 insertions(+), 18 deletions(-)

       via  e6805dea66e86c6cdad036407f16fe17f45b8f94 (commit)
      from  6ea7ba8654f7620a5e0ba4f66d653026b3f002fe (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 e6805dea66e86c6cdad036407f16fe17f45b8f94
Author: radhika <radhika at curoverse.com>
Date:   Fri May 16 00:25:50 2014 -0400

    2756: trigger event when object is updated. process the messages on trigger.

diff --git a/apps/workbench/app/assets/javascripts/event_log.js b/apps/workbench/app/assets/javascripts/event_log.js
index 61b4fdc..ae27e64 100644
--- a/apps/workbench/app/assets/javascripts/event_log.js
+++ b/apps/workbench/app/assets/javascripts/event_log.js
@@ -44,22 +44,16 @@ function onEventLogDispatcherOpen(event) {
 function onEventLogDispatcherMessage(event) {
   event_log_listener_map = $(window).data("event_log_listener_map");
 
+  parsedData = JSON.parse(event.data);
+  event_uuid = parsedData.object_uuid;
+  
   for (var key in event_log_listener_map) {
     value = event_log_listener_map[key];
-
-    new_properties = "";
-    eventData = JSON.parse(event.data);
-    if (value === eventData.object_uuid) {
-      properties = eventData.properties;
-      if (properties !== null) {
-        new_attributes = properties.new_attributes;
-        if (new_attributes !== null) {
-          new_properties = JSON.stringify(properties.new_attributes);
-        }
-      }
-
-      // append to the registered element
-      $('#'+key).append(eventData.summary + " " + new_properties + "
");
+    if (event_uuid === value) {
+      matches = ".event-listener[data-object-uuid=\"" + value + "\"]";
+      $(matches).trigger('arv-event', event.data);
     }
   }
+  // also trigger event for any listening for "all"
+  $('.event-listener[data-object-uuid="all"]').trigger('arv-event', event.data);
 }
diff --git a/apps/workbench/app/assets/javascripts/pipeline_instances.js b/apps/workbench/app/assets/javascripts/pipeline_instances.js
index 40b2762..27c2c7f 100644
--- a/apps/workbench/app/assets/javascripts/pipeline_instances.js
+++ b/apps/workbench/app/assets/javascripts/pipeline_instances.js
@@ -51,4 +51,23 @@
       }
     });
 
+    $(document).on('arv-event', '.event-handler-append-logs', function(event, eventData){
+      parsedData = JSON.parse(eventData);
+      summary = parsedData.summary;
+      properties = parsedData.properties;
+      updatedProperties = null;
+      if (properties !== null) {
+        new_attributes = properties.new_attributes;
+        if (new_attributes !== null) {
+          updatedProperties = JSON.stringify(properties.new_attributes);
+        }
+      }
+
+      if (updatedProperties !== null) {
+        $(this).append(updatedProperties + "<br/><br/>");
+      } else {
+        $(this).append(summary + "<br/><br/>");
+      }
+    });
+
 })();
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 38be3f5..1c1c4d9 100644
--- a/apps/workbench/app/views/pipeline_instances/_show_components.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_show_components.html.erb
@@ -116,8 +116,6 @@ setInterval(function(){$('a.refresh').click()}, 15000);
     $(window).data("listening-uuid", "<%=@object.uuid%>");
   </script>
 
-  <span>
-    <h3>Log for pipeline</h3>
-    <textarea class="event-listener" row="10" cols="80" id="pipeline_event_log_area"></textarea>
-  </span>
+  <h3>Log for pipeline</h3>
+  <div class="event-listener event-handler-append-logs" data-object-uuid="<%=@object.uuid%>"/>
 <% end %>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list