1 <% current_job = pj[:job] if pj[:job] != {} and pj[:job][:uuid] %>
2 <div class="panel panel-default">
3 <div class="panel-heading">
4 <div class="container-fluid">
7 <h4 class="panel-title">
8 <a data-toggle="collapse" href="#collapse<%= i %>" style="white-space: nowrap;">
9 <%= pj[:name] %> <span class="caret"></span>
15 <div class="col-md-1">
16 <%= render(partial: 'job_status_label', locals: { j: current_job }) %>
19 <div class="col-md-3">
20 <% if current_job[:started_at] %>
21 <% walltime = ((if current_job[:finished_at] then current_job[:finished_at] else Time.now() end) - current_job[:started_at]) %>
22 <% cputime = tasks.map { |task|
23 if task.started_at and task.job_uuid == current_job[:uuid]
24 (if task.finished_at then task.finished_at else Time.now() end) - task.started_at
29 <%= render_runtime(walltime, false, false) %>
30 <% if cputime > 0 %> / <%= render_runtime(cputime, false, false) %> (<%= (cputime/walltime).round(1) %>⨯)<% end %>
34 <% if current_job[:state].in? ["Complete", "Failed", "Cancelled"] %>
35 <div class="col-md-5 text-overflow-ellipsis">
36 <% if pj[:output_uuid] %>
37 <%= link_to_if_arvados_object pj[:output_uuid], friendly_name: true %>
38 <% elsif current_job[:output] %>
39 <%= link_to_if_arvados_object current_job[:output], link_text: "Output of #{pj[:name]}" %>
44 <% elsif current_job[:state] == "Running" %>
45 <div class="col-md-3 pipeline-instance-spacing">
46 <%= pj[:progress_bar] %>
48 <div class="col-md-1 pipeline-instance-spacing">
49 <%= form_tag "/jobs/#{current_job[:uuid]}/cancel", style: "display:inline; padding-left: 1em" do |f| %>
50 <%= hidden_field_tag :return_to, url_for(@object) %>
51 <%= button_tag "Cancel", {class: 'btn btn-xs btn-danger', id: "cancel-job-button"} %>
54 <% elsif current_job[:state] == "Queued" %>
55 <div class="col-md-5">
56 <% queuetime = Time.now - current_job[:created_at] %>
57 Queued for <%= render_runtime(queuetime, true) %>.
59 <% if current_job[:queue_position] == 0 %>
60 This job is next in the queue to run.
61 <% elsif current_job[:queue_position] == 1 %>
62 There is 1 job in the queue ahead of this one.
64 There are <%= current_job[:queue_position] %> jobs in the queue ahead of this one.
71 <div class="col-md-3 col-md-offset-3">
72 <span class="label label-default">Not ready</span>
79 <div id="collapse<%= i %>" class="panel-collapse collapse <%= if expanded then 'in' end %>">
80 <div class="panel-body">
81 <div class="container">
82 <% current_component = (if current_job then current_job else pj end) %>
84 <div class="col-md-6">
86 <% [:script, :repository, :script_version, :supplied_script_version, :nondeterministic].each do |k| %>
88 <td style="padding-right: 1em">
92 <% if current_component[k].nil? %>
95 <%= current_component[k] %>
100 <% if current_component[:runtime_constraints].andand[:docker_image] and current_component[:docker_image_locator] %>
102 <td style="padding-right: 1em">
106 <%= current_component[:runtime_constraints][:docker_image] %>
110 <td style="padding-right: 1em">
111 docker_image_locator:
114 <%= link_to_if_arvados_object current_component[:docker_image_locator], friendly_name: true %>
119 <td style="padding-right: 1em">
129 <div class="col-md-5">
131 <% [:uuid, :modified_by_user_uuid, :priority, :created_at, :started_at, :finished_at].each do |k| %>
133 <td style="padding-right: 1em">
138 <%= link_to_if_arvados_object current_component[k], link_text: current_component[k] %>
139 <% elsif k.to_s.end_with? 'uuid' %>
140 <%= link_to_if_arvados_object current_component[k], friendly_name: true %>
141 <% elsif k.to_s.end_with? '_at' %>
142 <%= render_localized_date(current_component[k]) %>
144 <%= current_component[k] %>
153 <div class="col-md-6">
154 <p>script_parameters:</p>
155 <pre><%= JSON.pretty_generate(current_component[:script_parameters]) rescue nil %></pre>
157 <% if current_component[:tasks_summary] %>
158 <div class="col-md-3">
160 <% [:done, :running, :failed, :todo].each do |d| %>
162 <td style="padding-right: 1em"><%= 'tasks:' if d == :done %></td>
163 <td style="padding-right: 1em"><%= d.to_s %></td>
164 <td><%= current_component[:tasks_summary][d] %></td>