1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 class JobsController < ApplicationController
6 skip_around_action :require_thread_api_token, if: proc { |ctrl|
7 Rails.configuration.anonymous_user_token and
8 'show' == ctrl.action_name
11 def generate_provenance(jobs)
12 return if params['tab_pane'] != "Provenance"
20 ProvenanceHelper::find_collections(j[:script_parameters]) do |hash, uuid|
21 collections << uuid if uuid
22 hashes << hash if hash
24 nodes[j[:script_version]] = {:uuid => j[:script_version]}
27 Collection.where(uuid: collections).each do |c|
28 nodes[c[:portable_data_hash]] = c
31 Collection.where(portable_data_hash: hashes).each do |c|
32 nodes[c[:portable_data_hash]] = c
35 @svg = ProvenanceHelper::create_provenance_graph nodes, "provenance_svg", {
37 :direction => :top_down,
38 :all_script_parameters => true,
39 :script_version_nodes => true}
45 @objects = Job.where(uuid: params[:uuid])
46 generate_provenance(@objects)
57 redirect_to params[:return_to]
64 generate_provenance([@object])
70 stderr_log_query(Rails.configuration.running_job_log_records_to_fetch).
71 map { |e| e.serializable_hash.merge({ 'prepend' => true }) }
72 respond_to do |format|
73 format.json { render json: @logs }
86 %w(Status Log Details Provenance Advanced)