%# Copyright (C) The Arvados Authors. All rights reserved.
SPDX-License-Identifier: AGPL-3.0 %>
<% wu = obj.work_unit(name) %>
<% render_log = wu.render_log %>
<% if render_log %>
<% log_url = url_for render_log[:log] %>
Download the log
<%= render(partial: render_log[:partial], locals: render_log[:locals]) %>
<% end %>
<% live_log_lines = wu.live_log_lines(Rails.configuration.Workbench.RunningJobLogRecordsToFetch).join("\n") %>
<% if !render_log or (live_log_lines.size > 0) %>
<%# Still running, or recently finished and logs are still available from logs table %>
<%# Show recent logs in terminal window %>
Recent logs
<%= live_log_lines %>
<%# Applying a long throttle suppresses the auto-refresh of this
partial that would normally be triggered by arv-log-event. %>
>
<% end %>