Class: RushJob::DashboardController

Inherits:
ApplicationController show all
Includes:
Pagy::Backend
Defined in:
app/controllers/rush_job/dashboard_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



18
19
20
21
22
23
# File 'app/controllers/rush_job/dashboard_controller.rb', line 18

def destroy
  RushJob.clear_queue(queue_params[:queue], queue_params[:priority])

  flash[:success] = t(:cleared_queue, queue: queue_params[:queue])
  redirect_to root_path, status: :see_other
end

#indexObject



7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/rush_job/dashboard_controller.rb', line 7

def index
  @pagy_locked_jobs, @locked_jobs = pagy(RushJob.locked_jobs, items: 10, page_param: :locked_jobs_page)
  @queue_groups = RushJob.queue_groups
  @pagy_queue, @job_queues = pagy_array(@queue_groups.keys, items: 10, page_param: :queue_page)

  respond_to do |format|
    format.html
    format.turbo_stream
  end
end