Class: Marty::ScheduleJobsDashboard

Inherits:
Form
  • Object
show all
Includes:
Extras::Layout
Defined in:
app/components/marty/schedule_jobs_dashboard.rb

Constant Summary

Constants included from Extras::Layout

Extras::Layout::BOOL_MAP, Extras::Layout::MAP_BOOL

Constants included from Permissions

Permissions::NETZKE_ENDPOINTS

Instance Method Summary collapse

Methods included from Extras::Layout

#bool_getter, #bool_setter, #dispfield, #enum_array, #enum_column, #enum_setter, #fieldset, #get_sorter, #hbox, #hspacer, #jsonb_field, #nullable_bool_column, #range_column, #range_field, #range_getter, #range_setter, #textarea_field, #tooltip, #vbox, #vspacer

Methods included from Permissions

#can_call_endpoint?, #can_perform_action?, #can_perform_actions, #current_user_roles, extended, #has_any_perm?, #has_marty_permissions, #has_perm?

Instance Method Details

#configure(c) ⇒ Object



6
7
8
9
10
11
12
# File 'app/components/marty/schedule_jobs_dashboard.rb', line 6

def configure(c)
  super
  c.items = [
    :schedule_jobs_grid,
    :schedule_jobs_warnings
  ]
end

#default_bbarObject



47
48
49
# File 'app/components/marty/schedule_jobs_dashboard.rb', line 47

def default_bbar
  []
end

#prepare_warningsObject



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/components/marty/schedule_jobs_dashboard.rb', line 14

def prepare_warnings
  djs = ::Marty::BackgroundJob::FetchMissingInScheduleCronJobs.call

  messages = djs.map do |dj|
    handler_str = dj.handler[/job_class.*\n/]
    job_class = handler_str.gsub('job_class:', '').strip

    "#{job_class} with cron #{dj.cron} is present in delayed_jobs table, " \
      'but is missing in the Dashboard.'
  end

  messages.join('<br>')
end