Commit Graph
6 Commits
Author SHA1 Message Date
kaitranntt bae323c0d3 refactor(web-server): extract usage module to usage/ directory
- create web-server/usage/ with 7 focused modules

- extract: types, disk-cache, data-aggregator, aggregator, handlers, routes

- original files now re-export for backward compatibility

- slim routes.ts (49 lines) delegates to handlers.ts (489 lines)
2025-12-19 16:02:18 -05:00
kaitranntt d64115f91a feat(analytics): add 24H hourly chart with caching and UI improvements
- Add GitHub link button next to connection status for quick issue reporting
- Add 24H button on analytics page with hourly granularity chart
- Add /api/usage/hourly endpoint with date range filtering
- Add hourly data aggregation and caching (disk + memory)
- Fix timezone display: convert UTC hours to local time in chart
- Fix CLIProxy Stats card loading state synchronization
- Bump disk cache version to 3 (includes hourly data)
2025-12-12 15:33:22 -05:00
kaitranntt 4005f1c01c feat(cli): standardize UI output with ui.ts abstraction layer 2025-12-12 05:11:59 -05:00
kaitranntt 790ac3c862 fix(cache): use ~/.ccs/cache/ for usage and update-check files
- usage-disk-cache.ts: usage-cache.json → cache/usage.json
- update-checker.ts: update-check.json → cache/update-check.json
- Both ensure cache directory exists before writing
- Update tests to use new cache paths
2025-12-10 18:32:35 -05:00
kaitranntt 49b4065186 feat(usage): add internal data aggregation and cost tracking 2025-12-09 23:41:47 -05:00
kaitranntt abb156d9f4 perf(analytics): instant dashboard loading with disk cache persistence
- Add React lazy loading for heavy pages (Analytics, Settings, etc.)
- Remove blocking prewarmUsageCache() from server startup
- Add disk cache module for persistent usage data storage
- Fix disk cache not being created on first Analytics visit
- Write cache immediately when daily data available (don't wait for all 3 types)

Dashboard now loads in <10ms from disk cache instead of waiting for
better-ccusage library on every visit.
2025-12-09 01:07:42 -05:00