Class: Graphql::Dashboard::DetailedTraces::TracesController

Inherits:
ApplicationController
  • Object
show all
Includes:
Installable
Defined in:
lib/graphql/dashboard/detailed_traces.rb

Instance Method Summary collapse

Methods included from Installable

#check_installed, included

Methods inherited from ApplicationController

#schema_class

Instance Method Details

#delete_all ⇒ Object



28
29
30
31
32
# File 'lib/graphql/dashboard/detailed_traces.rb', line 28

def delete_all
  schema_class.detailed_trace.delete_all_traces
  flash[:success] = "Deleted all traces."
  head :no_content
end

#destroy ⇒ Object



22
23
24
25
26
# File 'lib/graphql/dashboard/detailed_traces.rb', line 22

def destroy
  schema_class.detailed_trace.delete_trace(params[:id])
  flash[:success] = "Trace deleted."
  head :no_content
end

#index ⇒ Object



11
12
13
14
15
# File 'lib/graphql/dashboard/detailed_traces.rb', line 11

def index
  @last = params[:last]&.to_i || 50
  @before = params[:before]&.to_i
  @traces = schema_class.detailed_trace.traces(last: @last, before: @before)
end

#show ⇒ Object



17
18
19
20
# File 'lib/graphql/dashboard/detailed_traces.rb', line 17

def show
  trace = schema_class.detailed_trace.find_trace(params[:id].to_i)
  send_data(trace.trace_data)
end