2 collections = [current_obj.outputs, current_obj.docker_image].flatten.compact.uniq
3 collections_pdhs = collections.select {|x| !CollectionsHelper.match(x).nil?}.uniq.compact
4 collections_uuids = collections - collections_pdhs
5 preload_collections_for_objects collections_uuids if collections_uuids.any?
6 preload_for_pdhs collections_pdhs if collections_pdhs.any?
8 preload_objects_for_dataclass(Repository, [current_obj.repository], :name) if current_obj.repository
11 <div class="container">
13 <div class="col-md-5">
14 <% if current_obj.uuid.nil? %>
15 No <%= current_obj.title %> has been submitted yet.
18 <% keys = [:uuid, :modified_by_user_uuid, :created_at, :started_at, :finished_at, :container_uuid] %>
19 <% keys << :log_collection if @object.uuid != current_obj.uuid %>
20 <% keys << :outputs %>
21 <% keys.each do |k| %>
23 val = current_obj.send(k) if current_obj.respond_to?(k)
25 has_val = val.andand.any?
26 elsif k == :log_collection and current_obj.state_label == "Running"
34 <td style="padding-right: 1em">
39 <%= link_to_arvados_object_if_readable(val, val, link_text: val) %>
40 <% elsif k.to_s.end_with? 'uuid' %>
41 <%= link_to_arvados_object_if_readable(val, val, friendly_name: true) %>
42 <% elsif k.to_s.end_with? '_at' %>
43 <%= render_localized_date(val) %>
44 <% elsif k == :outputs and val.any? %>
45 <% if val.size == 1 %>
46 <%= link_to_arvados_object_if_readable(val[0], 'Output data not available', friendly_name: true) %>
48 <%= render partial: 'work_units/show_outputs', locals: {id: current_obj.uuid, outputs: val, align:""} %>
50 <% elsif k == :log_collection %>
51 <%= render partial: 'work_units/show_log_link', locals: {wu: current_obj} %>
62 <div class="col-md-6">
64 <% # link to repo tree/file only if the repo is readable and the commit is a sha1
65 repo = (/^[0-9a-f]{40}$/ =~ current_obj.script_version and
66 current_obj.repository and
67 object_for_dataclass(Repository, current_obj.repository, :name))
68 repo = nil unless repo.andand.http_fetch_url
70 <% [:priority, :script, :repository, :script_version, :supplied_script_version, :nondeterministic,
71 :runtime_constraints].each do |k| %>
72 <% val = current_obj.send(k) if current_obj.respond_to?(k) %>
75 <td style="padding-right: 1em">
79 <% if repo and k == :repository %>
80 <%= link_to val, show_repository_tree_path(id: repo.uuid, commit: current_obj.script_version, path: '/') %>
81 <% elsif repo and k == :script %>
82 <%= link_to val, show_repository_blob_path(id: repo.uuid, commit: current_obj.script_version, path: 'crunch_scripts/'+current_obj.script) %>
83 <% elsif repo and k == :script_version %>
84 <%= link_to val, show_repository_commit_path(id: repo.uuid, commit: current_obj.script_version) %>
85 <% elsif k == :runtime_constraints and val.any? %>
86 <%= render partial: 'work_units/show_table_data', locals: {id: current_obj.uuid, name: k, data_map: val} %>
96 mounts = current_obj.send(:mounts) if current_obj.respond_to?(:mounts)
97 mount_wf = mounts.andand[:"/var/lib/cwl/workflow.json"]
98 mount_wf_cls = resource_class_for_uuid(mount_wf) if mount_wf
101 <% if mount_wf_cls == Collection %>
102 <td style="padding-right: 1em">
106 <%= link_to_if_arvados_object mount_wf, friendly_name: true %>
111 <% if current_obj.runtime_constraints.andand[:docker_image] and current_obj.docker_image %>
113 <td style="padding-right: 1em">
117 <%= current_obj.runtime_constraints[:docker_image] %>
121 <td style="padding-right: 1em">
122 docker_image_locator:
125 <%= link_to_arvados_object_if_readable(current_obj.docker_image,
126 current_obj.docker_image, friendly_name: true) %>
129 <% elsif current_obj.docker_image %>
131 <td style="padding-right: 1em">
132 docker_image_locator:
135 <%= link_to_arvados_object_if_readable(current_obj.docker_image,
136 current_obj.docker_image, friendly_name: true) %>
143 <div class="col-md-11">
145 <% [:command].each do |k| %>
146 <% val = current_obj.send(k) if current_obj.respond_to?(k) %>
149 <td style="padding-right: 1em">
153 <% if k == :command %>
154 <div style="max-height:200px; border:1px solid; overflow-y:auto; padding-left: 1em; padding-right: 1em">
166 mounts = current_obj.send(:mounts) if current_obj.respond_to?(:mounts)
167 input_obj =mounts.andand[:"/var/lib/cwl/cwl.input.json"].andand[:content] || mounts || {}
169 cwl_input_collections(input_obj) do |_, path|
172 mnt_inputs = mnt_inputs.uniq.compact
175 <% if mnt_inputs.any? %>
176 <td style="padding-right: 1em">
180 <%= render partial: 'work_units/show_inputs',
181 locals: {id: current_obj.uuid, name: 'mount-inputs', inputs: mnt_inputs} %>
190 <% if current_obj.parameters and !current_obj.parameters.empty? %>
192 <div class="col-md-6">
193 <p>script_parameters:</p>
194 <pre><%= JSON.pretty_generate(current_obj.parameters) rescue nil %></pre>