From c847f249ba30ac3709ce9fc695944e402df23469 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Thu, 19 Mar 2026 15:42:49 +0100 Subject: [PATCH] Enhance daily statistics reporting in broadcast.js - Updated the statistics for 'today' to include a list of unique users who logged in, improving the detail and usefulness of the data presented. - Modified the command table structure to display metrics more clearly, including the date, total logins, and unique users logged in today. These changes enhance the clarity and depth of user engagement statistics. --- server/broadcast.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/broadcast.js b/server/broadcast.js index d56ba57..3ed8e3a 100644 --- a/server/broadcast.js +++ b/server/broadcast.js @@ -419,7 +419,13 @@ export function setupBroadcast(io, __dirname) { if (sub === 'today') { const day = new Date().toISOString().slice(0, 10); const dayRecords = records.filter((r) => r.day === day); - sendCommandTable(socket, 'Statistik: Heute', ['Tag', 'Logins'], [[day, dayRecords.length]]); + const uniqueUsersToday = Array.from(new Set(dayRecords.map((r) => r.userName))) + .sort((a, b) => a.localeCompare(b, 'de')); + sendCommandTable(socket, 'Statistik: Heute', ['Metrik', 'Wert'], [ + ['Tag', day], + ['Logins', dayRecords.length], + ['Heute eingeloggt', uniqueUsersToday.length > 0 ? uniqueUsersToday.join(', ') : '-'] + ]); return; } @@ -1376,4 +1382,3 @@ export function setupBroadcast(io, __dirname) { } }, 60000); } -