<%= link_to(_('Auto Reload'), '', class: %w(btn btn-sm btn-default reload-button hidden)) %>
<%= link_to(_('Dynflow console'),
format((defined?(Rails) ? request.script_name : '') + '/foreman_tasks/dynflow/%s', @task.external_id),
class: %w(btn btn-sm btn-default)) if Setting['dynflow_enable_console'] %>
<%= link_to(_('Resume'),
resume_foreman_tasks_task_path(@task),
class: ['btn', 'btn-sm', 'btn-primary', ('disabled' unless @task.resumable?)].compact,
method: :post) %>
<%= link_to(_('Unlock'),
'',
class: ['btn', 'btn-sm', 'btn-warning', 'reload-button-stop', ('disabled' unless @task.state == 'paused')].compact,
:'data-toggle' => "modal",
:'data-target' => "#unlock_modal") %>
<%= link_to(_('Force Unlock'),
'',
class: ['btn', 'btn-sm', 'btn-danger', 'reload-button-stop', ('disabled' if @task.state == 'stopped')].compact,
:'data-toggle' => "modal",
:'data-target' => "#force_unlock_modal") %>
<%= _("This will unlock the resources that the task is running against. Please note that this might lead to inconsistent state and should be used with caution, after making sure that the task can't be resumed") %>
<%= _("Resources will be unlocked and will not prevent other tasks from being run. As the task might be still running, it should be avoided to use this unless you are really sure the task got stuck") %>
<%= _("Id") %>:
<%= @task.id %>
<%= _("Label") %>:
<%= @task.label %>
<%= _("Name") %>:
<%= @task.humanized[:action] %>
<%= _("Owner") %>:
<%= @task.username %>
<%= _("Started at") %>:
<%= @task.started_at %>
<%= _("Ended at") %>:
<%= @task.ended_at %>
<%= _("State") %>:
<%= @task.state %>
<%= _("Result") %>:
<%= @task.result %>
<%= _("Params") %>:
<%= format_task_input(@task) %>
<% if @task.parent_task %>
<%= link_to(_("Parent task"), foreman_tasks_task_path(@task.parent_task)) %>
<% end %>
<% if @task.sub_tasks.any? %>
<%= link_to(_("Sub tasks"), sub_tasks_foreman_tasks_task_path(@task)) %>
<% end %>
<% progress = 100 * @task.progress %>
<% classes = ['progress-bar',
case @task.result
when 'success'
'progress-bar-success'
when 'error'
'progress-bar-danger'
else
nil
end]
%>
<%= progress %>% Complete
<%= progress.round %>%
<%= _("Output") %>:
<%= @task.humanized[:output] %>