You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(dashboard): polish charts, add time ranges, and visual refinements (#17)
* feat(dashboard): split single chart into stacked errors/warnings + traffic charts
Errors and warnings were invisible when info/debug counts were 10-50x larger
because all levels shared one y-axis. This splits the chart into two vertically
stacked panels with independent y-axes:
- Top panel "Errors & Warnings" (h-40): red + yellow datasets, x-axis labels
hidden to avoid duplication
- Bottom panel "Traffic Volume" (h-48): blue info + gray debug datasets, with
x-axis labels visible
Both panels share the same date labels for visual time-correlation. The new
splitDailyStatsChartConfigs() helper in charts.ts returns two separate Chart.js
config JSON strings; the existing dailyStatsChartConfig() is preserved.
Co-Authored-By: Claude <noreply@anthropic.com>
* feat(dashboard): add 7d/14d/30d time-range toggle to app detail charts
Adds three toggle buttons above the split Chart.js charts that let users
switch the stats window without a page reload. Clicking a button calls
loadStats() which fetches /dashboard/api/stats/:app_id?days=N and updates
both chart instances in-place (data.labels + data.datasets + chart.update()).
Stats cards and chart section title now reflect the active range dynamically
via Alpine.js x-text bindings. statsTotals state recalculates from the API
response on each range change so the four summary cards stay in sync.
Module-level ewChart/trafficChart vars are assigned in DOMContentLoaded and
closed over by the Alpine loadStats() method so no DOM query is needed on
each fetch. No backend changes required — the DO already supports ?days=N.
Co-Authored-By: Claude <noreply@anthropic.com>
* feat(dashboard): add grouped bar chart to overview page with time-range toggle
Extends the overview page with a grouped bar chart showing per-app errors
and warnings over the selected time range (7d/14d/30d). The chart updates
in-place when the range changes, reusing the same Alpine.js + Chart.js
in-place update pattern from the app-detail page.
- Add overviewBarChartConfig() to charts.ts for grouped bar chart config
- Add AppChartData/OverviewChartResponse types to dashboard/types.ts
- Add getOverviewChart() to api/overview.ts for multi-day per-day stats
- Add /dashboard/api/overview/chart?days=N endpoint to index.ts
- Update overview page with chart section, range buttons, and chart init
Co-Authored-By: Claude <noreply@anthropic.com>
* feat(dashboard): wire sparklines and error rate into stats cards
Add sparkline trend visualizations to all stats cards on both overview
and app-detail pages, pulling from existing sparkline() utility that was
previously unused. Error cards now also display an error rate percentage
("X% of all logs") to give context alongside raw counts.
- Extend statsCard() to accept optional sparklineHtml and subtext params
- Overview: 2-point sparklines (yesterday→today) for errors/warnings/info
- App-detail: full multi-day sparklines from stats[] history per level
- App-detail stats cards now use card-glow class for consistency
- Error rate shown on error card when >0%
Co-Authored-By: Claude <noreply@anthropic.com>
* feat(dashboard): add footer, improve empty states, and table hover transitions
Final visual polish sweep to make the dashboard presentation-ready:
- Add branded footer() to layout.ts, rendered in every page via htmlDocument()
showing brand name, service name, and "Powered by Cloudflare Workers & Durable Objects"
- Improve emptyState() helper to accept an optional hint text below the message
- Overview: use emptyState() with SVG icons for "no apps" and "no recent errors" states
- App-detail: upgrade "no logs found" state with clipboard icon, message, and filter hint
- Add log-row CSS class with 0.1s ease background transition for smooth table hovers
- Apply log-row class to all data rows in overview tables
- Tune app-detail stats cards: use var(--text-muted) for labels and add card-glow class
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor(dashboard): simplify chart configs, reduce duplication
Extract shared chart helpers (lineDataset, barDataset, CHART_SCALES,
CHART_BASE_OPTIONS), consolidate repeated sparkline options, remove
dead code in overview refresh, and add addStats helper. Net -91 lines.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments