+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
class JobsController < ApplicationController
- include JobsHelper
+ skip_around_action :require_thread_api_token, if: proc { |ctrl|
+ !Rails.configuration.Users.AnonymousUserToken.empty? and
+ 'show' == ctrl.action_name
+ }
def generate_provenance(jobs)
return if params['tab_pane'] != "Provenance"
nodes[j[:script_version]] = {:uuid => j[:script_version]}
end
- Collection.where(uuid: collections).each do |c|
+ Collection.where(uuid: collections).with_count("none").each do |c|
nodes[c[:portable_data_hash]] = c
end
- Collection.where(portable_data_hash: hashes).each do |c|
+ Collection.where(portable_data_hash: hashes).with_count("none").each do |c|
nodes[c[:portable_data_hash]] = c
end
end
def logs
- @logs = Log.select(%w(event_type object_uuid event_at properties))
- .order('event_at DESC')
- .filter([["event_type", "=", "stderr"],
- ["object_uuid", "in", [@object.uuid]]])
- .limit(500)
- .results
- .to_a
- .map{ |e| e.serializable_hash.merge({ 'prepend' => true }) }
+ @logs = @object.
+ stderr_log_query(Rails.configuration.Workbench.RunningJobLogRecordsToFetch).
+ map { |e| e.serializable_hash.merge({ 'prepend' => true }) }
respond_to do |format|
format.json { render json: @logs }
end
def show_pane_list
%w(Status Log Details Provenance Advanced)
end
-
- def rerun_job_with_options_popup
- respond_to do |format|
- format.js
- format.html
- end
- end
-
- def rerun_job_with_options
- job_info = JSON.parse params['job_info']
-
- @object = Job.new
- @object.script = job_info['script']
- @object.repository = job_info['repository']
- @object.nondeterministic = job_info['nondeterministic']
- @object.script_parameters = job_info['script_parameters']
- @object.runtime_constraints = job_info['runtime_constraints']
-
- if params['use_script'] == 'latest'
- @object.script_version = job_info['supplied_script_version']
- else
- @object.script_version = job_info['script_version']
- end
-
- @object.save!
- show
- end
end