From 1341830ed23bb60d4c6f7cb213c465cddb37a932 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 20 Nov 2025 14:39:09 -0500 Subject: [PATCH] Add total counts and restructure admin stats dashboard - Add total counts for accounts and identities alongside 7-day and 24-hour metrics - Change layout from horizontal to vertical stacking Co-Authored-By: Claude --- app/controllers/admin/stats_controller.rb | 2 ++ app/views/admin/stats/show.html.erb | 30 ++++++++++++++++------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/app/controllers/admin/stats_controller.rb b/app/controllers/admin/stats_controller.rb index d9e64dc27..25d19ad31 100644 --- a/app/controllers/admin/stats_controller.rb +++ b/app/controllers/admin/stats_controller.rb @@ -4,9 +4,11 @@ class Admin::StatsController < AdminController layout "public" def show + @accounts_total = Account.count @accounts_last_7_days = Account.where(created_at: 7.days.ago..).count @accounts_last_24_hours = Account.where(created_at: 24.hours.ago..).count + @identities_total = Identity.count @identities_last_7_days = Identity.where(created_at: 7.days.ago..).count @identities_last_24_hours = Identity.where(created_at: 24.hours.ago..).count diff --git a/app/views/admin/stats/show.html.erb b/app/views/admin/stats/show.html.erb index cfa71997d..2fe7ce71a 100644 --- a/app/views/admin/stats/show.html.erb +++ b/app/views/admin/stats/show.html.erb @@ -6,14 +6,18 @@
-
-

Recent Activity

-
- -
-
-
Accounts Created
+
+
+
+

Accounts Created

+
+
+
Total
+
+ <%= @accounts_total %> +
+
7 days
@@ -29,9 +33,17 @@
-
-
Identities Created
+
+
+

Identities Created

+
+
+
Total
+
+ <%= @identities_total %> +
+
7 days