6602: use min_nodes * (finished_at - started_at) to calculate the allocated node...
[arvados.git] / apps / workbench / app / controllers / jobs_controller.rb
index b1ef33a8e526f0c7d7de32f7cb6fef30f144702d..398417734c71c34f2aaac71fbf700eaf4d5f50d1 100644 (file)
@@ -1,5 +1,8 @@
 class JobsController < ApplicationController
-  include JobsHelper
+  skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+    Rails.configuration.anonymous_user_token and
+    'show' == ctrl.action_name
+  }
 
   def generate_provenance(jobs)
     return if params['tab_pane'] != "Provenance"
@@ -64,7 +67,8 @@ class JobsController < ApplicationController
                         ["object_uuid", "in", [@object.uuid]]])
                .limit(500)
                .results
-               .reverse
+               .to_a
+               .map{ |e| e.serializable_hash.merge({ 'prepend' => true }) }
     respond_to do |format|
       format.json { render json: @logs }
     end