Skip to content

feat: add Server Dashboard & Activity Monitor#658

Open
datlechin wants to merge 8 commits intomainfrom
feat/server-dashboard
Open

feat: add Server Dashboard & Activity Monitor#658
datlechin wants to merge 8 commits intomainfrom
feat/server-dashboard

Conversation

@datlechin
Copy link
Copy Markdown
Collaborator

Summary

  • New Server Dashboard tab type showing live server state with auto-refresh
  • Active Sessions panel: PID, user, database, state, duration, running query with Kill/Cancel actions (confirmation alert)
  • Server Metrics panel: Connection count, cache hit ratio, database size, uptime, active queries — displayed as horizontal metric cards with SF Symbol icons
  • Slow Queries panel: Collapsible list of queries running > 1 second with duration highlighting
  • Auto-refresh: Configurable interval (1s/2s/5s/10s/30s/off), default 5s, pause/resume
  • 6 database providers with graceful degradation:
    • PostgreSQL: full support (sessions, metrics, slow queries, kill, cancel)
    • MySQL/MariaDB: full support
    • MSSQL: sessions + metrics + slow queries + kill
    • ClickHouse: sessions + metrics + slow queries + kill
    • DuckDB: metrics only
    • SQLite: metrics only
  • Entry points: menu bar ("Server Dashboard") + toolbar button
  • One dashboard tab per window (deduplicates on open)
  • Tab persistence across sessions

Architecture

  • ServerDashboardQueryProvider protocol — each database owns both query SQL and result parsing
  • ServerDashboardViewModel (@mainactor @observable) — Task-based refresh loop, per-panel error handling
  • Follows ER Diagram tab pattern exactly (TabType, QueryTabManager, coordinator extension, per-tab VM dict)
  • 16 new files, 8 modified files, 1,628 lines added

Test plan

  • PostgreSQL: verify sessions, metrics, slow queries panels populate
  • MySQL: verify sessions, metrics, slow queries panels populate
  • SQLite: verify only metrics panel visible, others hidden
  • Auto-refresh: change interval, pause/resume, manual refresh (Cmd+R)
  • Kill session: confirmation alert → execute → list refreshes
  • Tab persistence: close and reopen, dashboard tab restores
  • Menu "Server Dashboard" disabled for NoSQL databases (Redis, MongoDB)
  • Toolbar dashboard button disabled when disconnected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant