Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class MissionControl::Jobs::GroupedJobsController < MissionControl::Jobs::ApplicationController
def index
if ActiveJob::Base.queue_adapter.is_a?(ActiveJob::QueueAdapters::SolidQueueAdapter)
@grouped_jobs = SolidQueue::FailedExecution.joins(:job).group(:class_name).count
else
redirect_to jobs_path
end
end
end
1 change: 1 addition & 0 deletions app/helpers/mission_control/jobs/navigation_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module MissionControl::Jobs::NavigationHelper

def navigation_sections
{ queues: [ "Queues", application_queues_path(@application) ] }.tap do |sections|
sections[:grouped_failed_jobs] = [ "Grouped Failed jobs (#{jobs_count_with_status(:failed)})", application_grouped_jobs_path(@application, :failed) ]
supported_job_statuses.without(:pending).each do |status|
sections[navigation_section_for_status(status)] = [ "#{status.to_s.titleize} jobs (#{jobs_count_with_status(status)})", application_jobs_path(@application, status) ]
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<table class="jobs failed table queues is-hoverable is-fullwidth">
<thead>
<tr>
<th class="job-header">Job class</th>
<th>Count</th>
</tr>
</thead>
<tbody>
<% @grouped_jobs.each do |klass, count|%>
<tr>
<td><%= klass %></td>
<td><%= count %></td>
</tr>
<% end %>
</tbody>
</table>
11 changes: 11 additions & 0 deletions app/views/mission_control/jobs/grouped_jobs/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<% navigation(title: "Grouped jobs", section: :grouped_jobs) %>

<% if @grouped_jobs.empty? && !active_filters? %>
<%= blank_status_notice "There are no grouped jobs #{blank_status_emoji(:grouped_jobs)}" %>
<% else %>
<% if @grouped_jobs.empty? %>
<%= blank_status_notice "No grouped jobs found with the given filters" %>
<% else %>
<%= render "mission_control/jobs/grouped_jobs/grouped_jobs_page", grouped_jobs: @grouped_jobs %>
<% end %>
<% end %>
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
end

resources :jobs, only: :index, path: ":status/jobs"
resources :grouped_jobs, only: :index, path: "failed/grouped_jobs"

resources :workers, only: [ :index, :show ]
resources :recurring_tasks, only: [ :index, :show, :update ]
Expand Down