11870: minor update
[arvados.git] / apps / workbench / app / controllers / jobs_controller.rb
index 1ae8e50a1db484e472958fa6c9d448c316f99309..c39b7c4317d56fdcd7d31f95116e23572bcbec49 100644 (file)
@@ -1,4 +1,8 @@
 class JobsController < ApplicationController
+  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"
@@ -26,6 +30,7 @@ class JobsController < ApplicationController
 
     @svg = ProvenanceHelper::create_provenance_graph nodes, "provenance_svg", {
       :request => request,
+      :direction => :top_down,
       :all_script_parameters => true,
       :script_version_nodes => true}
   end
@@ -56,7 +61,13 @@ class JobsController < ApplicationController
     super
   end
 
-  def push_logs
+  def logs
+    @logs = @object.
+      stderr_log_query(Rails.configuration.running_job_log_records_to_fetch).
+      map { |e| e.serializable_hash.merge({ 'prepend' => true }) }
+    respond_to do |format|
+      format.json { render json: @logs }
+    end
   end
 
   def index_pane_list