1 class JobsController < ApplicationController
4 def generate_provenance(jobs)
5 return if params['tab_pane'] != "Provenance"
13 ProvenanceHelper::find_collections(j[:script_parameters]) do |hash, uuid|
14 collections << uuid if uuid
15 hashes << hash if hash
17 nodes[j[:script_version]] = {:uuid => j[:script_version]}
20 Collection.where(uuid: collections).each do |c|
21 nodes[c[:portable_data_hash]] = c
24 Collection.where(portable_data_hash: hashes).each do |c|
25 nodes[c[:portable_data_hash]] = c
28 @svg = ProvenanceHelper::create_provenance_graph nodes, "provenance_svg", {
30 :all_script_parameters => true,
31 :script_version_nodes => true}
37 @objects = Job.where(uuid: params[:uuid])
38 generate_provenance(@objects)
49 redirect_to params[:return_to]
56 generate_provenance([@object])
61 @logs = Log.select(%w(event_type object_uuid event_at properties))
62 .order('event_at DESC')
63 .filter([["event_type", "=", "stderr"],
64 ["object_uuid", "in", [@object.uuid]]])
68 .map{ |e| e.serializable_hash.merge({ 'prepend' => true }) }
69 respond_to do |format|
70 format.json { render json: @logs }
83 %w(Status Log Details Provenance Advanced)