Class: ActiveAgent::Dashboard::DashboardController

Inherits:
ApplicationController show all
Defined in:
lib/active_agent/dashboard/app/controllers/active_agent/dashboard/dashboard_controller.rb

Overview

Main dashboard controller showing overview metrics and recent activity.

Instance Method Summary collapse

Instance Method Details

#indexObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/active_agent/dashboard/app/controllers/active_agent/dashboard/dashboard_controller.rb', line 8

def index
  unless ActiveAgent::Dashboard.use_inertia && defined?(InertiaRails)
    # No ERB overview ships yet — the traces list is the dashboard.
    # Loading agent/run data here would also require the full
    # dashboard tables, which telemetry-only installs don't have.
    return redirect_to(traces_path)
  end

  @agents = fetch_agents.limit(10)
  @recent_runs = fetch_recent_runs.limit(10)
  @recent_traces = fetch_recent_traces.limit(10)
  @metrics = calculate_metrics

  render inertia: "Dashboard", props: {
    agents: serialize_agents(@agents),
    recentRuns: serialize_runs(@recent_runs),
    recentTraces: serialize_traces(@recent_traces),
    metrics: @metrics,
    user: current_user_props,
    account: 
  }
end