feat: Replace CLI admin panel with web-based one - #594
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR removes the Ink-based admin CLI and introduces an authenticated Cloud admin panel with NestJS APIs, reporting services, Remix routing, and web tabs for overview, users, projects, organisations, and database diagnostics. ChangesAdmin panel
Estimated code review effort: 5 (Critical) | ~120 minutes Sequence Diagram(s)sequenceDiagram
participant Admin as Admin browser
participant Route as Remix admin route
participant API as NestJS AdminController
participant Service as AdminService
participant DB as MySQL and ClickHouse
Admin->>Route: Request selected admin tab
Route->>API: Fetch authenticated admin data
API->>Service: Validate and delegate request
Service->>DB: Query reporting and entity data
DB-->>Service: Return aggregated results
Service-->>API: Return admin payload
API-->>Route: Return response and cookies
Route-->>Admin: Render admin tab
Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
backend/apps/cloud/src/admin/admin.service.ts (1)
753-764: 🚀 Performance & Scalability | 🔵 Trivial | ⚖️ Poor tradeoff
inactive-*filter may build an unboundedNOT INlist.getProjectsWithRecentEvents(days)returns every project id with recent events across the whole instance, which is then spread intoproject.id NOT IN (:...activePids). On large deployments this can be tens of thousands of parameters, risking MySQLmax_allowed_packet/placeholder limits and slow query planning. Consider inverting the logic (compute the archived-eligible set from the smaller inactive side, or join against a temp table / use a subquery) rather than a largeNOT IN.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@backend/apps/cloud/src/admin/admin.service.ts` around lines 753 - 764, Update the inactive-* branch in the admin service to avoid spreading all IDs returned by getProjectsWithRecentEvents into a project.id NOT IN parameter list. Express the exclusion using a database-side subquery or join that identifies projects with recent events, while preserving the archived=false and inactive semantics without an unbounded parameter count.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@web/app/pages/Admin/UsersTab.tsx`:
- Around line 408-413: The user rows rendered in the users map are mouse-only
because the clickable <tr> elements cannot receive focus or keyboard activation.
Update the row around onUserSelect to add an appropriate interactive role,
tabIndex, and onKeyDown handler that triggers onUserSelect for Enter and Space
while preserving the existing click behavior.
---
Nitpick comments:
In `@backend/apps/cloud/src/admin/admin.service.ts`:
- Around line 753-764: Update the inactive-* branch in the admin service to
avoid spreading all IDs returned by getProjectsWithRecentEvents into a
project.id NOT IN parameter list. Express the exclusion using a database-side
subquery or join that identifies projects with recent events, while preserving
the archived=false and inactive semantics without an unbounded parameter count.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 4454d42d-27f8-4902-afbf-79f82f778ef5
⛔ Files ignored due to path filters (1)
admin/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (40)
admin/README.mdadmin/package.jsonadmin/src/billing/pricing.tsadmin/src/commands/InactiveProjectsCommand.tsxadmin/src/commands/LimitsCommand.tsxadmin/src/commands/OrgsCommand.tsxadmin/src/commands/ProjectsCommand.tsxadmin/src/commands/RecentActivityCommand.tsxadmin/src/commands/SearchCommand.tsxadmin/src/commands/StatsCommand.tsxadmin/src/commands/TopProjectsCommand.tsxadmin/src/commands/UsersCommand.tsxadmin/src/components/App.tsxadmin/src/components/Spinner.tsxadmin/src/components/Table.tsxadmin/src/db/clickhouse.tsadmin/src/db/mysql.tsadmin/src/entities/organisation-member.entity.tsadmin/src/entities/organisation.entity.tsadmin/src/entities/project.entity.tsadmin/src/entities/user.entity.tsadmin/src/index.tsxadmin/tsconfig.jsonbackend/.env.examplebackend/apps/cloud/src/admin/admin.controller.tsbackend/apps/cloud/src/admin/admin.module.tsbackend/apps/cloud/src/admin/admin.service.tsbackend/apps/cloud/src/admin/decorators/admin-auth.decorator.tsbackend/apps/cloud/src/admin/guards/admin-access.guard.tsbackend/apps/cloud/src/app.module.tsweb/app/lib/constants/index.tsweb/app/pages/Admin/DatabaseTab.tsxweb/app/pages/Admin/OrganisationsTab.tsxweb/app/pages/Admin/OverviewTab.tsxweb/app/pages/Admin/ProjectsTab.tsxweb/app/pages/Admin/UsersTab.tsxweb/app/pages/Admin/components.tsxweb/app/pages/Admin/index.tsxweb/app/pages/Admin/types.tsweb/app/routes/admin.tsx
💤 Files with no reviewable changes (23)
- admin/README.md
- admin/src/entities/organisation-member.entity.ts
- admin/src/components/Spinner.tsx
- admin/tsconfig.json
- admin/src/commands/InactiveProjectsCommand.tsx
- admin/src/entities/project.entity.ts
- admin/package.json
- admin/src/entities/user.entity.ts
- admin/src/entities/organisation.entity.ts
- admin/src/index.tsx
- admin/src/components/App.tsx
- admin/src/commands/RecentActivityCommand.tsx
- admin/src/commands/StatsCommand.tsx
- admin/src/billing/pricing.ts
- admin/src/commands/SearchCommand.tsx
- admin/src/components/Table.tsx
- admin/src/db/mysql.ts
- admin/src/commands/LimitsCommand.tsx
- admin/src/commands/UsersCommand.tsx
- admin/src/commands/ProjectsCommand.tsx
- admin/src/commands/OrgsCommand.tsx
- admin/src/db/clickhouse.ts
- admin/src/commands/TopProjectsCommand.tsx
Changes
If applicable, please describe what changes were made in this pull request.
Community Edition support
Database migrations
Documentation
Summary by CodeRabbit