Commit Graph

5 Commits

Author SHA1 Message Date
6e00291a88 feat: AI usage user details + styled modals across app
- Add /admin/ai-usage/user/<id> route for detailed AI usage per user
- Add ai_usage_user.html template with stats, usage breakdown, logs
- Make user names clickable in AI usage dashboard ranking
- Replace all native browser dialogs (alert, confirm) with styled modals/toasts:
  - admin/fees.html, forum.html, recommendations.html, announcements.html, debug.html
  - calendar/admin.html, event.html
  - company_detail.html, company/recommend.html
  - forum/new_topic.html, topic.html
  - classifieds/view.html
  - auth/reset_password.html

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 10:30:35 +01:00
684235ad2a fix: AI monitoring dashboard bug fixes
- Fix type_labels keys to match actual feature names (ai_chat, zopk_news_evaluation)
- Fix SQLAlchemy query syntax (remove invalid .options())
- Add null safety for daily_history values in template

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 08:55:59 +01:00
3e77ffd206 feat: Add user/company rankings and period filters to AI dashboard
- Add period filter buttons (day/week/month/all)
- Add user ranking table with name, company, requests, tokens, cost
- Add company ranking table with unique users and costs
- Show user names in recent logs
- Add all-time statistics
- Rankings filtered by selected period

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 08:35:00 +01:00
18ac0218d0 fix: Correct dashboard endpoint name in AI usage template
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 08:22:25 +01:00
bfe1cd897c feat: Add AI usage monitoring dashboard
- Add AIUsageLog, AIUsageDaily, AIRateLimit models to database.py
- Update gemini_service.py to log to new AIUsageLog table
- Create /admin/ai-usage dashboard with stats and charts
- Show daily/weekly/monthly requests, tokens, costs
- Track usage by type (chat, news_evaluation, etc.)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 08:21:07 +01:00