X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/70148c4918a95ee9a49a18bf5789801d02e8ef5e..6b49793347e98146ec96373a6b48f56fac46b881:/apps/workbench/app/controllers/jobs_controller.rb diff --git a/apps/workbench/app/controllers/jobs_controller.rb b/apps/workbench/app/controllers/jobs_controller.rb index b7526c949a..e6d0ccd3bd 100644 --- a/apps/workbench/app/controllers/jobs_controller.rb +++ b/apps/workbench/app/controllers/jobs_controller.rb @@ -1,19 +1,28 @@ class JobsController < ApplicationController + include JobsHelper def generate_provenance(jobs) return if params['tab_pane'] != "Provenance" - nodes = [] + nodes = {} collections = [] + hashes = [] jobs.each do |j| - nodes << j - collections << j[:output] - collections.concat(ProvenanceHelper::find_collections(j[:script_parameters])) - nodes << {:uuid => j[:script_version]} + nodes[j[:uuid]] = j + hashes << j[:output] + ProvenanceHelper::find_collections(j[:script_parameters]) do |hash, uuid| + collections << uuid if uuid + hashes << hash if hash + end + nodes[j[:script_version]] = {:uuid => j[:script_version]} end Collection.where(uuid: collections).each do |c| - nodes << c + nodes[c[:portable_data_hash]] = c + end + + Collection.where(portable_data_hash: hashes).each do |c| + nodes[c[:portable_data_hash]] = c end @svg = ProvenanceHelper::create_provenance_graph nodes, "provenance_svg", { @@ -36,7 +45,11 @@ class JobsController < ApplicationController def cancel @object.cancel - redirect_to @object + if params[:return_to] + redirect_to params[:return_to] + else + redirect_to @object + end end def show @@ -44,6 +57,10 @@ class JobsController < ApplicationController super end + def push_logs + @push_logs = stderr_log_records([@object.uuid]) + end + def index_pane_list if params[:uuid] %w(Recent Provenance) @@ -53,6 +70,6 @@ class JobsController < ApplicationController end def show_pane_list - %w(Status Attributes Provenance Metadata JSON API) + %w(Status Log Details Provenance Advanced) end end