Merge branch 'master' into 3889-functional-testing
[arvados.git] / apps / workbench / app / controllers / application_controller.rb
index 756339e5be3924f59032b5dc2956da4b41cd240b..4b775c6036af8bd37c848c2dfc5bf227a41cbfb7 100644 (file)
@@ -213,7 +213,7 @@ class ApplicationController < ActionController::Base
       end
       f.html {
         if params['tab_pane']
-          render_pane params['tab_pane']
+          render_pane(if params['tab_pane'].is_a? Hash then params['tab_pane']["name"] else params['tab_pane'] end)
         elsif request.method.in? ['GET', 'HEAD']
           render
         else
@@ -694,7 +694,29 @@ class ApplicationController < ActionController::Base
 
   helper_method :running_pipelines
   def running_pipelines
-    PipelineInstance.order(["started_at asc", "created_at asc"]).filter([["state", "in", ["RunningOnServer", "RunningOnClient"]]])
+    pi = PipelineInstance.order(["started_at asc", "created_at asc"]).filter([["state", "in", ["RunningOnServer", "RunningOnClient"]]])
+    jobs = {}
+    pi.each do |pl|
+      pl.components.each do |k,v|
+        if v.is_a? Hash and v[:job]
+          jobs[v[:job][:uuid]] = {}
+        end
+      end
+    end
+
+    Job.filter([["uuid", "in", jobs.keys]]).each do |j|
+      jobs[j[:uuid]] = j
+    end
+
+    pi.each do |pl|
+      pl.components.each do |k,v|
+        if v.is_a? Hash and v[:job]
+          v[:job] = jobs[v[:job][:uuid]]
+        end
+      end
+    end
+
+    pi
   end
 
   helper_method :finished_pipelines