def outputs
items = []
- children.each do |c|
- items.concat c.outputs
- end
- if !items.any?
- items << get(:output) if get(:output)
- end
+ items << get(:output) if get(:output)
items
end
def created_at
t = get(:created_at)
- t = Time.parse(t) if (t.andand.class == String)
+ t = Time.parse(t) if (t.is_a? String)
t
end
def started_at
t = get(:started_at)
- t = Time.parse(t) if (t.andand.class == String)
+ t = Time.parse(t) if (t.is_a? String)
t
end
def modified_at
t = get(:modified_at)
- t = Time.parse(t) if (t.andand.class == String)
+ t = Time.parse(t) if (t.is_a? String)
t
end
def finished_at
t = get(:finished_at)
- t = Time.parse(t) if (t.andand.class == String)
+ t = Time.parse(t) if (t.is_a? String)
t
end
<h4>Node status</h4>
-<% active_nodes = 0 %>
<div class="compute-summary-nodelist">
- <% nodes.sort_by { |n| n.hostname || "" }.each do |n| %>
- <% if n.crunch_worker_state.in? ["busy", "idle"] and (Time.now - n[:last_ping_at]) < 3600 %>
- <% active_nodes += 1 %>
+ <% nodes.each do |n| %>
<div class="compute-summary">
<a data-toggle="collapse" href="#detail_<%= n.hostname %>" class="compute-summary-head label label-<%= if n.crunch_worker_state == 'busy' then 'primary' else 'default' end %>">
<%= n.hostname %>
<% end %>
</div>
</div>
- <% end %>
- <% end %>
- <% if active_nodes == 0 %>
- No active nodes
<% end %>
</div>
<div class="compute-summary-numbers">
<table>
<colgroup>
- <col width="25%">
- <col width="25%">
- <col width="25%">
+ <col width="50%">
+ <col width="50%">
</colgroup>
<tr>
- <td><%= Job.queue_size %></td>
<td><%= nodes.select {|n| n.crunch_worker_state == "busy" }.size %></td>
<td><%= nodes.select {|n| n.crunch_worker_state == "idle" }.size %></td>
</tr>
<tr>
- <th>Queued jobs</th>
<th>Busy nodes</th>
<th>Idle nodes</th>
</tr>
<div class="row">
<div class="col-md-6">
<div class="panel panel-default" style="min-height: 10.5em">
- <div class="panel-heading"><span class="panel-title">Recent processes</span>
+ <div class="panel-heading"><span class="panel-title">Recent pipelines and processes</span>
<% if current_user.andand.is_active %>
<span class="pull-right">
<span>
<% _recent_processes = recent_processes(12) %>
<div class="panel-body recent-processes">
<% if _recent_processes.empty? %>
- No recent processes.
+ No recent pipelines or processes.
<% else %>
<% _recent_processes.each do |p| %>
<% wu = p.work_unit %>
<div class="panel-body compute-node-summary-pane">
<div>
<%= render partial: 'compute_node_summary', locals: {nodes: nodes} %>
- <div style="text-align: center">
- <a data-toggle="collapse" href="#compute_node_status">Details <span class="caret"></span></a>
- </div>
+ <% active_nodes = [] %>
+ <% nodes.sort_by { |n| n.hostname || "" }.each do |n| %>
+ <% if n.crunch_worker_state.in? ["busy", "idle"] and (Time.now - n[:last_ping_at]) < 3600 %>
+ <% active_nodes << n %>
+ <% end %>
+ <% end %>
+ <% if active_nodes.any? %>
+ <div style="text-align: center">
+ <a data-toggle="collapse" href="#compute_node_status">Details <span class="caret"></span></a>
+ </div>
+ <% end %>
</div>
<div id="compute_node_status" class="collapse">
- <%= render partial: 'compute_node_status', locals: {nodes: nodes} %>
+ <%= render partial: 'compute_node_status', locals: {nodes: active_nodes} %>
</div>
</div>
</div>
first('button', text: 'x').click
end
- assert_text 'Recent processes' # seeing dashboard now
+ assert_text 'Recent pipelines and processes' # seeing dashboard now
end
end
test "visit dashboard as #{token}" do
visit page_with_token(token)
- assert_text 'Recent processes' # seeing dashboard now
+ assert_text 'Recent pipelines and processes' # seeing dashboard now
within('.recent-processes') do
page.has_button? 'Run a pipeline'
page.has_link? 'All pipelines'
test "login with api_token works after redirect" do
visit page_with_token('active_trustedclient')
- assert page.has_text?('Recent processes'), "Missing 'Recent processes' from page"
+ assert page.has_text?('Recent pipelines and processes'), "Missing 'Recent pipelines and processes' from page"
assert_no_match(/\bapi_token=/, current_path)
end
assert page.has_text? 'Textile description for pipeline template'
assert page.has_link? 'Go to dashboard'
click_link 'Go to dashboard'
- assert page.has_text? 'Recent processes'
+ assert page.has_text? 'Recent pipelines and processes'
# again visit recent templates page and verify edited description
visit page_with_token("active", "/pipeline_templates")
assert page.has_text?('Save profile'), 'No text - Save profile'
add_profile user
else
- assert page.has_text?('Recent processes'), 'Not found text - Recent processes'
+ assert page.has_text?('Recent pipelines and processes'), 'Not found text - Recent pipelines and processes'
assert page.has_no_text?('Save profile'), 'Found text - Save profile'
end
elsif invited
end
# profile saved and in home page now
- assert page.has_text?('Recent processes'), 'No text - Recent processes'
+ assert page.has_text?('Recent pipelines and processes'), 'No text - Recent pipelines and processes'
end
[