-
-
Save Paxa/9913290 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ActiveAdmin.register Delayed::Job do | |
| menu parent: 'Admin' | |
| actions :index, :show, :edit, :delete | |
| index do | |
| column :id | |
| column :priority | |
| column :attempts | |
| column :created_at | |
| column :run_at | |
| column :locked_by | |
| column :locked_at | |
| default_actions | |
| end | |
| form do |f| | |
| f.inputs "Scheduling" do | |
| f.input :priority | |
| f.input :queue | |
| f.input :run_at | |
| end | |
| f.inputs "Details" do | |
| f.input :id, input_html: {disabled: true} | |
| f.input :created_at, input_html: {disabled: true} | |
| f.input :updated_at, input_html: {disabled: true} | |
| f.input :handler, input_html: {disabled: true} | |
| end | |
| f.inputs "Diagnostics" do | |
| f.input :attempts | |
| f.input :failed_at, input_html: {disabled: true} | |
| f.input :last_error, input_html: {disabled: true} | |
| f.input :locked_at, input_html: {disabled: true} | |
| f.input :locked_by, input_html: {disabled: true} | |
| end | |
| f.buttons | |
| end | |
| member_action :run_now, :method => :post do | |
| job = Delayed::Job.find(params[:id]) | |
| job.update_attributes run_at: Time.now | |
| redirect_to action: :index | |
| end | |
| sidebar "Perform", only: [:show, :edit] do | |
| # aa creates extremely weird routes for the DJ model atm | |
| a 'Schedule for now!', href: "#{request.path}/run_now", 'data-method' => :post | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment