Class: McpLogs::CallsController

Inherits:
ApplicationController show all
Includes:
Pagy::Method
Defined in:
app/controllers/mcp_logs/calls_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/mcp_logs/calls_controller.rb', line 5

def index
  scope = Call.recent
    .for_method(params[:method])
    .for_tool(params[:tool])
    .with_status(params[:status])
    .for_session(params[:session])

  @pagy, @calls = pagy(:offset, scope, limit: McpLogs.page_size)

  # The filter dropdowns list what has actually been logged, so they can never
  # offer a method or tool that would return an empty page.
  @methods = filter_options(:rpc_method, params[:method])
  @tools = filter_options(:tool_name, params[:tool])
end

#showObject



20
21
22
# File 'app/controllers/mcp_logs/calls_controller.rb', line 20

def show
  @call = Call.find(params[:id])
end