Class: Marty::BackgroundJob::DelayedJobsGrid

Inherits:
Grid
  • Object
show all
Defined in:
app/components/marty/background_job/delayed_jobs_grid.rb

Constant Summary collapse

ACCESSIBLE_BY =
[:admin]

Constants included from Permissions

Permissions::NETZKE_ENDPOINTS

Instance Method Summary collapse

Methods inherited from Grid

#child_components, #class_can?, #configure_form_window, #get_json_sorter, #has_search_action?, #initialize, #linked_components

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?

Constructor Details

This class inherits a constructor from Marty::Grid

Instance Method Details

#configure(c) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'app/components/marty/background_job/delayed_jobs_grid.rb', line 17

def configure(c)
  super

  c.title ||= I18n.t(
    'schedule_jobs_dashboard_view_title',
    default: 'Delayed Jobs Dashboard'
  )

  c.model = 'Delayed::Job'
  c.paging = :buffered
  c.editing = :in_form
  c.multi_select = false

  c.attributes = [
    :id,
    :handler,
    :run_at,
    :locked_at,
    :locked_by,
    :created_at,
    :cron,
    :last_error
  ]

  c.store_config.merge!(
    sorters: [
      { property: :locked_at, direction: 'DESC' },
      { property: :run_at, direction: 'DESC' }
    ])

  # c.scope = lambda do |r|
  # r.order('locked_at DESC NULLS LAST')
  # end
end

#default_bbarObject



62
63
64
# File 'app/components/marty/background_job/delayed_jobs_grid.rb', line 62

def default_bbar
  []
end

#default_context_menuObject



58
59
60
# File 'app/components/marty/background_job/delayed_jobs_grid.rb', line 58

def default_context_menu
  []
end