discourse/app/models/concerns/reports
Alan Guo Xiang Tan 87e695fc53
FEATURE: Add site traffic dashboard section (#40023)
Makes the redesigned dashboard Site traffic section real for the core
traffic summary.

- In scope: live pageview headline, comparison trend, logged-in share
KPI, and stacked traffic chart.
- Out of scope: top referrers, top countries, and narrative traffic
insights. Those remain placeholder UI for a follow-up.
- Reuses the existing report stacked chart for both the dashboard
section and `/admin/reports/site_traffic`.
- Extends the existing site traffic report data contract instead of
introducing a dashboard-only chart shape.
- Keeps traffic aggregation, KPI calculation, and trend eligibility on
the backend.
- Supports dashboard preset and custom date ranges with inclusive date
windows.
- Ships traffic data in this section payload shape:

```json
{
  "id": "traffic",
  "data": {
    "kpis": {
      "browser_pageviews": {
        "value": 30,
        "percent_change": 900,
        "comparison_period": {
          "start_date": "2026-04-28",
          "end_date": "2026-04-30"
        }
      },
      "logged_in_share": {
        "value": 33
      }
    },
    "pageview_series": [
      {
        "req": "page_view_logged_in_browser",
        "label": "Logged in",
        "color": "#4B3CE0",
        "data": [
          { "x": "2026-05-01", "y": 10 }
        ]
      }
    ]
  }
}
```
2026-05-19 14:08:21 +08:00
..
admin_logins.rb DEV: rename staff_logins report to admin_logins (#39840) 2026-05-11 10:49:09 +10:00
associated_accounts_by_provider.rb FIX: Update associated accounts report to handle Discourse Connect (#34462) 2025-08-21 13:51:06 -04:00
bookmarks.rb
consolidated_api_requests.rb DEV: Convert AdminReport component to gjs (#31011) 2025-01-29 10:33:43 +10:00
consolidated_page_views.rb DEV: Convert AdminReport component to gjs (#31011) 2025-01-29 10:33:43 +10:00
consolidated_page_views_browser_detection.rb FEATURE: Switch to new methods of pageview measurement and reporting (#28729) 2024-09-10 09:51:49 +10:00
daily_engaged_users.rb
dau_by_mau.rb
emails.rb
flags.rb
flags_status.rb DEV: Convert AdminReport component to gjs (#31011) 2025-01-29 10:33:43 +10:00
likes.rb
mobile_visits.rb
moderator_warning_private_messages.rb
moderators_activity.rb DEV: Convert AdminReport component to gjs (#31011) 2025-01-29 10:33:43 +10:00
new_contributors.rb
notify_moderators_private_messages.rb
notify_user_private_messages.rb
post_edits.rb SECURITY: Do not leak PM post edits to moderators 2026-03-19 15:21:28 +00:00
posts.rb DEV: Convert AdminReport component to gjs (#31011) 2025-01-29 10:33:43 +10:00
profile_views.rb
signups.rb
site_traffic.rb FEATURE: Add site traffic dashboard section (#40023) 2026-05-19 14:08:21 +08:00
storage_stats.rb
suspicious_logins.rb DEV: Convert AdminReport component to gjs (#31011) 2025-01-29 10:33:43 +10:00
system_private_messages.rb
time_to_first_response.rb DEV: Fix assigned but unused variable Prism warnings (#39436) 2026-04-22 12:42:14 +02:00
top_ignored_users.rb DEV: Convert AdminReport component to gjs (#31011) 2025-01-29 10:33:43 +10:00
top_referred_topics.rb DEV: Convert AdminReport component to gjs (#31011) 2025-01-29 10:33:43 +10:00
top_referrers.rb DEV: Convert AdminReport component to gjs (#31011) 2025-01-29 10:33:43 +10:00
top_traffic_sources.rb DEV: Convert AdminReport component to gjs (#31011) 2025-01-29 10:33:43 +10:00
top_uploads.rb FEATURE: system themes (#32681) 2025-06-13 10:36:31 +08:00
top_users_by_likes_received.rb DEV: Convert AdminReport component to gjs (#31011) 2025-01-29 10:33:43 +10:00
top_users_by_likes_received_from_a_variety_of_people.rb DEV: Convert AdminReport component to gjs (#31011) 2025-01-29 10:33:43 +10:00
top_users_by_likes_received_from_inferior_trust_level.rb DEV: Convert AdminReport component to gjs (#31011) 2025-01-29 10:33:43 +10:00
topic_view_stats.rb DEV: Convert AdminReport component to gjs (#31011) 2025-01-29 10:33:43 +10:00
topics.rb
topics_with_no_response.rb
trending_search.rb DEV: Convert AdminReport component to gjs (#31011) 2025-01-29 10:33:43 +10:00
trust_level_growth.rb FIX: ensures colors are set for tl-growth report (#33294) 2025-06-21 12:55:23 +02:00
user_flagging_ratio.rb DEV: Convert AdminReport component to gjs (#31011) 2025-01-29 10:33:43 +10:00
user_to_user_private_messages.rb
user_to_user_private_messages_with_replies.rb
users_by_trust_level.rb DEV: Convert AdminReport component to gjs (#31011) 2025-01-29 10:33:43 +10:00
users_by_type.rb DEV: Convert AdminReport component to gjs (#31011) 2025-01-29 10:33:43 +10:00
visits.rb UX: refactor User Visit report and layout for all reports (#37627) 2026-03-06 08:53:17 +08:00
web_crawlers.rb DEV: Convert AdminReport component to gjs (#31011) 2025-01-29 10:33:43 +10:00
web_hook_events_daily_aggregate.rb FEATURE: Add WebHookEventsDailyAggregate report page (#27573) 2024-06-27 10:26:42 -03:00