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.Users.AnonymousUserToken.empty? 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).with_count("none").each do |c|
28 nodes[c[:portable_data_hash]] = c
31 Collection.where(portable_data_hash: hashes).with_count("none").each do |c|
32 nodes[c[:portable_data_hash]] = c
35 @svg = ProvenanceHelper::create_provenance_graph nodes, "provenance_svg", {
37 :all_script_parameters => true,
38 :script_version_nodes => true}
44 @objects = Job.where(uuid: params[:uuid])
45 generate_provenance(@objects)
56 redirect_to params[:return_to]
63 generate_provenance([@object])
69 stderr_log_query(Rails.configuration.Workbench.RunningJobLogRecordsToFetch).
70 map { |e| e.serializable_hash.merge({ 'prepend' => true }) }
71 respond_to do |format|
72 format.json { render json: @logs }
85 %w(Status Log Details Provenance Advanced)