Dev dashboard - #211
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Code Review
This pull request introduces a mobile API with dedicated routes and authentication, enhances log streaming with cursor-based positioning and SSE event typing, and implements a project-wide ESLint rule banning direct useEffect usage in favor of useMountEffect. It also refactors server-side configuration and integrates alerting services. Feedback was provided to optimize the geo-aggregation logic in the mobile route by merging redundant loops into a single pass for better efficiency.
This comment was marked as resolved.
This comment was marked as resolved.
Replace defaultAgentToken with defaultAgentConfigured across runtime/server and client configs; default agent token is no longer exposed (token set to empty). Improve mobile routes: requireMobileApiKey test added for OPTIONS preflight, serializeAgentForMobile no longer includes token, add periodic cleanup for mobile geo cache and run cleanup before resolving, and add a 10s fetch timeout that returns 504 on agent timeout. Propagate abort signals to agent health/status checks and add timeout handling in useAgentHealth and AgentContext.checkAgentStatus. UX and performance tweaks: extract Discord/PlayStore/AppStore icons to a new ui/icons module and import them in DashboardSidebar, remove unused agentName prop, stabilize Map draw handlers by using a ref for onLayersChange and narrowing effect deps, simplify LogContext memoization, and clear IndexedDB logs when resetting logs in useLogFetcher. Also add small error logging around agent refreshes and update TypeScript runtime config types and tests to reflect the defaultAgentConfigured change.
Validate and tighten runtime and agent handling, fix event listener stability, and improve UX/error handling. Key changes: - server/config: validate DASHBOARD_DENSITY against allowed values (compact/comfortable) and default to comfortable. - runtime-config: remove configuredAgentUrl from runtime shape to avoid exposing internal URL. - types/agent & agent-config-manager: make agent.token optional (undefined by default) and remove required-token validation to support env-managed agents. - AgentFormModal: ensure token field is initialized to an empty string when missing. - DashboardSidebar: render disabled sidebar items as <button> with aria-disabled and preventDefault for better accessibility. - map component: use refs and stable callback handlers for locationfound/locationerror to ensure proper add/remove of listeners and avoid stale closures. - place-autocomplete: keep onResultsChange in a ref and call it when results clear or on errors; remove it from effect deps to avoid unnecessary fetches. - useLogFetcher: memoize returned state and reset function, useCallback for resetAndLoadRecent, and rely on clearLogsFromIDB to handle its own errors. - AgentContext: surface a toast on agent refresh failure and handle AbortError specially when checking agent status. - LogContext: remove redundant useMemo and return logFetcher state directly. These changes improve stability, avoid exposing internal configuration, and make UI interactions and async flows more resilient.
Export the configured GEOIP cache max entries from location.ts so other routes (mobile) can report the actual limit instead of a hardcoded value. Use that exported GEOIP_CACHE_MAX_ENTRIES in the mobile agents geo response cacheStats. Make the proxy router more defensive: log a warning and fall back to http://localhost:5000 if proxyAgent.target is missing. In multi-agent API client, avoid sending an Authorization header when the agent has no token (prevents 'Bearer undefined'). These changes improve correctness of reported cache info, robustness of proxy routing, and prevent sending invalid auth headers.
Add support for configurable internal IP ranges and intro-skip, make top-items limit configurable, and apply various UI/logic fixes. - Introduce DASHBOARD_SKIP_INTRO env var and config.skipIntroPage, and auto-redirect HomePage to /dashboard when enabled. - Add internalIPRanges to FilterSettings, default values, FilterContext merging, SettingsFiltersPage UI for adding/removing ranges, and filter-utils logic to exclude logs matching those ranges when Hide Internal Traffic is enabled. - Implement CIDR/exact-IP matching utilities (matchesIPRange, matchesAnyIPRange) in ip-utils. - Make calculateMetrics accept a topItemsLimit (propagated from TabbedDashboard via config.trafficTopItemsLimit) so top lists are configurable. - Improve ResponseTimeGauge and OverviewSection to display "N/A" when there are no samples. - Fix useAgentHealth auto-check to avoid interval teardown/recreation by using a stable ref for checkAllAgents and tighten effect dependencies. - Fix docker-compose service env for TRAEFIK_LOG_DASHBOARD_ERROR_PATH to point to traefik.log instead of access.log. These changes enable better internal traffic filtering, configurable dashboard limits, clearer UI when data is missing, and stability fixes for health monitoring.
Summary by CodeRabbit
New Features
Improvements
Chores
Tests