1 class JobsController < ApplicationController
2 skip_around_filter :require_thread_api_token, if: proc { |ctrl|
3 Rails.configuration.anonymous_user_token and
4 'show' == ctrl.action_name
7 def generate_provenance(jobs)
8 return if params['tab_pane'] != "Provenance"
16 ProvenanceHelper::find_collections(j[:script_parameters]) do |hash, uuid|
17 collections << uuid if uuid
18 hashes << hash if hash
20 nodes[j[:script_version]] = {:uuid => j[:script_version]}
23 Collection.where(uuid: collections).each do |c|
24 nodes[c[:portable_data_hash]] = c
27 Collection.where(portable_data_hash: hashes).each do |c|
28 nodes[c[:portable_data_hash]] = c
31 @svg = ProvenanceHelper::create_provenance_graph nodes, "provenance_svg", {
33 :direction => :top_down,
34 :all_script_parameters => true,
35 :script_version_nodes => true}
41 @objects = Job.where(uuid: params[:uuid])
42 generate_provenance(@objects)
53 redirect_to params[:return_to]
60 generate_provenance([@object])
66 stderr_log_query(Rails.configuration.running_job_log_records_to_fetch).
67 map { |e| e.serializable_hash.merge({ 'prepend' => true }) }
68 respond_to do |format|
69 format.json { render json: @logs }
82 %w(Status Log Details Provenance Advanced)