Class: Observ::SessionsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/observ/sessions_controller.rb

Instance Method Summary collapse

Instance Method Details

#annotations_drawerObject



26
27
28
29
30
# File 'app/controllers/observ/sessions_controller.rb', line 26

def annotations_drawer
  @session = Observ::Session.find(params[:id])
  @annotations = @session.annotations.recent
  @annotation = @session.annotations.build
end

#drawer_testObject



22
23
24
# File 'app/controllers/observ/sessions_controller.rb', line 22

def drawer_test
  @session = Observ::Session.find(params[:id])
end

#indexObject



3
4
5
6
7
8
# File 'app/controllers/observ/sessions_controller.rb', line 3

def index
  @sessions = Observ::Session.order(start_time: :desc)
  @agent_types = distinct_agent_types
  apply_filters if params[:filter].present?
  @sessions = @sessions.page(params[:page]).per(Observ.config.pagination_per_page)
end

#metricsObject



17
18
19
20
# File 'app/controllers/observ/sessions_controller.rb', line 17

def metrics
  @session = Observ::Session.find(params[:id])
  render json: @session.session_metrics
end

#showObject



10
11
12
13
14
15
# File 'app/controllers/observ/sessions_controller.rb', line 10

def show
  @session = Observ::Session.find(params[:id])
  @traces = @session.traces.order(start_time: :asc)
  @session_metrics = @session.session_metrics
  @chat = @session.chat
end