Class: Marty::ApiLogView

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

Constant Summary collapse

DATE_OP_MAP =
{
  'eq' => '=',
  'gt' => '>',
  'lt' => '<'
}
@@attrs =
[
  :script,
  :node,
  :attrs,
  :input,
  :output,
  :error,
  :remote_ip,
  :auth_name,
  :start_time,
  :end_time,
]

Constants included from Extras::Layout

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

Constants included from Permissions

Permissions::ALL_ROLES, Permissions::REQ_ROLES

Instance Method Summary collapse

Methods included from Extras::Layout

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

Methods inherited from Grid

#class_can?, #configure_form_window, #get_json_sorter, #has_search_action?

Methods included from Permissions

#can_perform_action?, #can_perform_actions, #current_user_roles, #has_any_perm?, #has_marty_permissions

Instance Method Details

#configure(c) ⇒ Object



25
26
27
28
29
30
31
32
33
34
# File 'app/components/marty/api_log_view.rb', line 25

def configure(c)
  super
  c.editing = :in_form
  c.paging = :buffered
  c.title = 'Api Log View'
  c.model = Marty::Log
  c.attributes = @@attrs
  c.scope = {message_type: 'api'}
  c.store_config.merge!(sorters: [{property: :timestamp, direction: 'DESC'}])
end

#default_form_itemsObject



41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'app/components/marty/api_log_view.rb', line 41

def default_form_items
  [
    :script,
    :node,
    :attrs,
    :start_time,
    :end_time,
    textarea_field(:input).merge!({height: 300}),
    textarea_field(:output).merge!({height: 300}),
    :error,
    :remote_ip,
    :auth_name,
  ]
end