Module: SidekiqAdminEnquerer::WebApp Private
- Defined in:
- lib/sidekiq_admin_enquerer/web_app.rb,
lib/sidekiq_admin_enquerer/web_app/app_control.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Defined Under Namespace
Modules: AppControl, WebHelpers Classes: JobMethodWrapper, JobParamWrapper, JobWrapper
Constant Summary collapse
- TEMPLATES =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
{ jobs: File.read(File.join(File.(__dir__), 'pages', 'jobs.erb')), job: File.read(File.join(File.(__dir__), 'pages', 'job.erb')) }.freeze
Class Method Summary collapse
- .registered(app) ⇒ void private
Class Method Details
.registered(app) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/sidekiq_admin_enquerer/web_app.rb', line 27 def registered(app) app.helpers(WebHelpers) app.get('/enquerer') do @jobs = AppControl.jobs render(:erb, TEMPLATES[:jobs]) end app.get('/enquerer/:job_name') do @job = AppControl.find_job(params[:job_name]) render(:erb, TEMPLATES[:job]) end app.post('/enquerer') do AppControl.run_job(params) redirect File.join(root_path, 'enquerer') end end |