2 recent_procs = recent_processes(12)
6 recent_procs.each do |p|
11 outputs = outputs.flatten.uniq
13 collection_pdhs = outputs.select {|x| !(m = CollectionsHelper.match(x)).nil?}.uniq.compact
14 collection_uuids = outputs - collection_pdhs
16 if Rails.configuration.show_recent_collections_on_dashboard
17 recent_cs = recent_collections(8)
18 collection_uuids = collection_uuids + recent_cs[:collections].collect {|c| c.uuid}
19 collection_uuids.flatten.uniq
22 preload_collections_for_objects collection_uuids if collection_uuids.any?
23 preload_for_pdhs collection_pdhs if collection_pdhs.any?
24 preload_links_for_objects(collection_pdhs + collection_uuids)
28 recent_procs_panel_width = 6
29 if !PipelineInstance.api_exists?(:index)
30 recent_procs_title = 'Recent processes'
31 run_proc_title = 'Choose a workflow to run:'
32 show_node_status = false
33 # Recent processes panel should take the entire width when is the only one
35 if !Rails.configuration.show_recent_collections_on_dashboard
36 recent_procs_panel_width = 12
39 recent_procs_title = 'Recent pipelines and processes'
40 run_proc_title = 'Choose a pipeline or workflow to run:'
41 show_node_status = true
46 <div class="col-md-<%= recent_procs_panel_width %>">
47 <div class="panel panel-default" style="min-height: 10.5em">
48 <div class="panel-heading">
49 <span class="panel-title"><%=recent_procs_title%></span>
50 <% if current_user.andand.is_active %>
51 <span class="pull-right recent-processes-actions">
54 choose_work_unit_templates_path(
55 title: run_proc_title,
56 action_name: 'Next: choose inputs <i class="fa fa-fw fa-arrow-circle-right"></i>',
57 action_href: work_units_path,
58 action_method: 'post',
59 action_data: {'selection_param' => 'work_unit[template_uuid]', 'work_unit[owner_uuid]' => current_user.uuid, 'success' => 'redirect-to-created-object'}.to_json),
60 { class: "btn btn-primary btn-xs", remote: true }) do %>
61 <i class="fa fa-fw fa-gear"></i> Run a process...
65 <%= link_to all_processes_path, class: 'btn btn-default btn-xs' do %>
66 All processes <i class="fa fa-fw fa-arrow-circle-right"></i>
73 <div class="panel-body recent-processes">
74 <% if recent_procs.empty? %>
75 No recent pipelines or processes.
77 <% wus.each do |p, wu| %>
78 <% if wu.is_finished? %>
79 <div class="dashboard-panel-info-row row-<%=wu.uuid%>">
81 <div class="col-md-6 text-overflow-ellipsis">
82 <%= link_to_if_arvados_object p, {friendly_name: true} %>
84 <div class="col-md-2">
85 <span class="label label-<%=wu.state_bootstrap_class%>"><%=wu.state_label%></span>
87 <div class="col-md-4">
88 <%= render_localized_date(wu.finished_at || wu.modified_at, "noseconds") %>
92 <div class="col-md-12">
93 <% if wu.started_at and wu.finished_at %>
94 <% wu_time = wu.finished_at - wu.started_at %>
95 Active for <%= render_runtime(wu_time, false) %>
98 <%= render partial: 'work_units/show_output', locals: {wu: wu, align: 'pull-right', include_icon: true} %>
104 <div class="dashboard-panel-info-row row-<%=wu.uuid%>">
106 <div class="col-md-6">
107 <%= link_to_if_arvados_object p, {friendly_name: true} %>
109 <% if wu.is_running? %>
110 <div class="col-md-6">
111 <div class="progress" style="margin-bottom: 0px">
116 <div class="col-md-2">
117 <span class="label label-<%=wu.state_bootstrap_class%>"><%=wu.state_label%></span>
123 children = wu.children
124 running = children.select { |c| c.state_label == "Running" }
125 queued = children.select { |c| c.state_label == "Queued" }
128 <div class="clearfix">
129 Started at <%= render_localized_date(wu.started_at || wu.created_at, "noseconds") %>.
130 <% wu_time = Time.now - (wu.started_at || wu.created_at) %>
131 Active for <%= render_runtime(wu_time, false) %>.
133 <div class="pull-right">
134 <% running.each do |r| %>
135 <span class="label label-<%= r.state_bootstrap_class %>"> <%= r.label || r.state_label || 'Not ready' %> </span>
137 <% queued.each do |q| %>
138 <span class="label label-<%= q.state_bootstrap_class %>"> <%= q.label || r.state_label || 'Not ready' %> </span>
150 <div class="col-md-6">
151 <% if show_node_status %>
152 <% nodes = Node.filter([["last_ping_at", ">", Time.now - 3600]]).results %>
153 <div class="panel panel-default" style="min-height: 10.5em">
154 <div class="panel-heading"><span class="panel-title">Compute node status</span>
155 <span class="pull-right compute-node-actions">
156 <% if current_user.andand.is_admin %>
158 <%= link_to nodes_path, class: 'btn btn-default btn-xs' do %>
159 All nodes <i class="fa fa-fw fa-arrow-circle-right"></i>
165 <div class="panel-body compute-node-summary-pane">
167 <%= render partial: 'compute_node_summary', locals: {nodes: nodes} %>
168 <% active_nodes = [] %>
169 <% nodes.sort_by { |n| n.hostname || "" }.each do |n| %>
170 <% if n.crunch_worker_state.in? ["busy", "idle"] %>
171 <% active_nodes << n %>
174 <% if active_nodes.any? %>
175 <div style="text-align: center">
176 <a data-toggle="collapse" href="#compute_node_status">Details <span class="caret"></span></a>
180 <div id="compute_node_status" class="collapse">
181 <%= render partial: 'compute_node_status', locals: {nodes: active_nodes} %>
186 <% if Rails.configuration.show_recent_collections_on_dashboard %>
187 <div class="panel panel-default">
188 <div class="panel-heading"><span class="panel-title">Recent collections</span>
189 <span class="pull-right">
190 <%= link_to collections_path, class: 'btn btn-default btn-xs' do %>
191 All collections <i class="fa fa-fw fa-arrow-circle-right"></i>
195 <div class="panel-body">
196 <% recent_cs[:collections].each do |p| %>
197 <div class="dashboard-panel-info-row">
199 <% if recent_cs[:owners][p[:owner_uuid]].is_a?(Group) %>
200 <i class="fa fa-fw fa-folder-o"></i><%= link_to_if_arvados_object recent_cs[:owners][p[:owner_uuid]], friendly_name: true %>/
202 <span class="pull-right"><%= render_localized_date(p[:modified_at], "noseconds") %></span>
204 <div class="text-overflow-ellipsis" style="margin-left: 1em; width: 100%"><%= link_to_if_arvados_object p, {friendly_name: true, no_tags: true} %>