Class: RoundhouseUi::ScheduledController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- RoundhouseUi::ScheduledController
- Includes:
- JobSetBrowsing
- Defined in:
- app/controllers/roundhouse_ui/scheduled_controller.rb
Constant Summary
Constants included from JobSetBrowsing
JobSetBrowsing::BULK_CAP, JobSetBrowsing::FILTER_KEYS, JobSetBrowsing::MAX_QUERY_LENGTH, JobSetBrowsing::NO_FILTER, JobSetBrowsing::PER_PAGE
Constants inherited from ApplicationController
ApplicationController::AUDIT_VERBS
Instance Method Summary collapse
- #destroy ⇒ Object
-
#enqueue ⇒ Object
Enqueue now — pulls the job out of the schedule and onto its queue.
- #index ⇒ Object
Methods included from JobSetBrowsing
#active_filters, #browse, #bulk_apply, #bulk_filter_present?, #bulk_matches, #bulk_refusal_reason, #class_filter, #entry_matches?, #entry_selected?, #entry_tagged?, #entry_tags, #error_filter, #filter, #load_filters, #query_refused?, #queue_filter, #tag_cache_for, #tag_filter
Methods inherited from ApplicationController
allow_in_read_only, guard_in_read_only, #redirect_to, requires_capability
Instance Method Details
#destroy ⇒ Object
21 22 23 24 25 |
# File 'app/controllers/roundhouse_ui/scheduled_controller.rb', line 21 def destroy entry = backend.scheduled_set.find_job(params[:jid]) entry&.delete redirect_to scheduled_path, notice: entry ? "Deleted #{params[:jid]}." : "Job is no longer scheduled." end |
#enqueue ⇒ Object
Enqueue now — pulls the job out of the schedule and onto its queue.
15 16 17 18 19 |
# File 'app/controllers/roundhouse_ui/scheduled_controller.rb', line 15 def enqueue entry = backend.scheduled_set.find_job(params[:jid]) entry&.add_to_queue redirect_to scheduled_path, notice: entry ? "Enqueued #{params[:jid]} now." : "Job is no longer scheduled." end |
#index ⇒ Object
8 9 10 11 12 |
# File 'app/controllers/roundhouse_ui/scheduled_controller.rb', line 8 def index @page = [ params[:page].to_i, 1 ].max @total = backend.scheduled_set.size @jobs, @has_next = browse(backend.scheduled_set, @query, @page, PER_PAGE, tag: @tag) end |