%
# Copyright (C) 2011 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see .
%>
<% provide :page_title do %><%= t :title, "Jobs CP" %><% end %>
<% css_bundle :slickgrid %>
<% deferred_js_bundle :jobs %>
<%= t 'headings.jobs_list', "Jobs List" %>
<%= options_for_select([[t('job_options.current', "Current"), 'current'],
[t('job_options.future', "Future"), 'future'],
[t('job_options.failed', "Failed"), 'failed'],
[t('job_options.id', "ID"), 'id'],
[t('job_options.strand', "Strand"), 'strand'],
[t('job_options.tag', "Tag"), 'tag'],
], @flavor) %>
<%= t '#buttons.refresh', "refresh" %>
<%= before_label :total_jobs, "Total" %> <%= @jobs_count %>
<% if Account.site_admin.grants_right?(@current_user, :manage_jobs) %>
<%= t 'buttons.select_all', 'select all' %>
<%= before_label :with_selection, "With Selection" %>
<%= t 'buttons.hold', 'hold' %>
<%= t 'buttons.un_hold', 'un-hold' %>
<%= t 'buttons.delete', 'delete' %>
<% end %>
<%= t 'headings.selected_job', "Selected Job" %>
<%= before_label :id, "id" %>
<%= before_label :tag, "tag" %>
<%= before_label :strand, "strand" %>
<%= before_label :singleton, "singleton" %>
<%= before_label :shard, "shard" %>
<%= before_label :priority, "Priority" %>
<%= before_label :num_attempts, "Attempts" %>
<%= before_label :max_attempts, "Max Attempts" %>
<%= before_label :locked_by, "Locked By" %>
<%= before_label :run_at, "Run At" %>
<%= before_label :locked_at, "Locked At" %>
<% if defined?(Marginalia) %>
<%= before_label :source, "Source" %>
<% end %>
<%= before_label :failed_at, "Failed At" %>
<%= before_label :original_job_id, "Original Job ID" %>
<%= before_label :handler, "Handler" %>
(<%= t 'actions.show', "show" %>)
<%= before_label :last_error, "Last Error" %>
(<%= t 'actions.show', "show" %>)
<%
jobs_opts = {
:max_attempts => Delayed::Settings.max_attempts,
:flavor => @flavor,
:url => jobs_v1_index_url(:only => :jobs),
:batch_update_url => batch_update_jobs_v1_index_url,
:job_url => jobs_v1_index_url,
:on_hold_attempt_count => Delayed::Job::ON_HOLD_COUNT,
:limit => JobsController::LIMIT,
:starting_query => params[:q],
:slow_threshold => 10.minutes,
:super_slow_threshold => 1.hour
}
running_opts = jobs_opts.merge({
:url => jobs_v1_index_url(:only => :running),
:refresh_rate => @running_jobs_refresh_seconds * 1000,
:starting_query => nil,
})
tags_opts = {
:url => jobs_v1_index_url(:only => :tags),
:refresh_rate => @job_tags_refresh_seconds * 1000,
}
js_env :JOBS => {
:opts => jobs_opts.as_json(:include_root => false),
:running_opts => running_opts.as_json(:include_root => false),
:tags_opts => tags_opts
}
%>