Merge branch '8784-dir-listings'
[arvados.git] / apps / workbench / app / views / work_units / _show_log.html.erb
1 <%# Copyright (C) The Arvados Authors. All rights reserved.
2
3 SPDX-License-Identifier: AGPL-3.0 %>
4
5 <% wu = obj.work_unit(name) %>
6
7 <% render_log = wu.render_log %>
8 <% if render_log %>
9   <div>
10     <% log_url = url_for render_log[:log] %>
11     <p> <a href="<%= log_url %>">Download the log</a> </p>
12     <%= render(partial: render_log[:partial], locals: render_log[:locals]) %>
13   </div>
14 <% end %>
15
16 <% live_log_lines = wu.live_log_lines(Rails.configuration.running_job_log_records_to_fetch).join("\n") %>
17 <% if !render_log or (live_log_lines.size > 0) %>
18 <%# Still running, or recently finished and logs are still available from logs table %>
19 <%# Show recent logs in terminal window %>
20 <h4>Recent logs</h4>
21 <div id="event_log_div"
22      class="arv-log-event-listener arv-log-event-handler-append-logs arv-job-log-window"
23      data-object-uuids="<%= wu.log_object_uuids.join(' ') %>"
24   ><%= live_log_lines %>
25 </div>
26
27 <%# Applying a long throttle suppresses the auto-refresh of this
28     partial that would normally be triggered by arv-log-event. %>
29 <div class="arv-log-refresh-control"
30      data-load-throttle="86486400000" <%# 1001 nights %>>
31 </div>
32 <% end %>