X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a59152e34814f453a7380e68a55534e2f8922d57..f883adf66c3da731904d5c25c779a13416ce9193:/apps/workbench/app/controllers/jobs_controller.rb?ds=inline diff --git a/apps/workbench/app/controllers/jobs_controller.rb b/apps/workbench/app/controllers/jobs_controller.rb index 1cd3c3e28e..b7526c949a 100644 --- a/apps/workbench/app/controllers/jobs_controller.rb +++ b/apps/workbench/app/controllers/jobs_controller.rb @@ -1,5 +1,58 @@ class JobsController < ApplicationController + + def generate_provenance(jobs) + return if params['tab_pane'] != "Provenance" + + nodes = [] + collections = [] + jobs.each do |j| + nodes << j + collections << j[:output] + collections.concat(ProvenanceHelper::find_collections(j[:script_parameters])) + nodes << {:uuid => j[:script_version]} + end + + Collection.where(uuid: collections).each do |c| + nodes << c + end + + @svg = ProvenanceHelper::create_provenance_graph nodes, "provenance_svg", { + :request => request, + :all_script_parameters => true, + :script_version_nodes => true} + end + def index - @jobs = Job.all + @svg = "" + if params[:uuid] + @objects = Job.where(uuid: params[:uuid]) + generate_provenance(@objects) + render_index + else + @limit = 20 + super + end + end + + def cancel + @object.cancel + redirect_to @object + end + + def show + generate_provenance([@object]) + super + end + + def index_pane_list + if params[:uuid] + %w(Recent Provenance) + else + %w(Recent) + end + end + + def show_pane_list + %w(Status Attributes Provenance Metadata JSON API) end end