From e8e1eb4e25f93aa91c8a2a474f1eb0452972a985 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Thu, 19 Mar 2026 15:45:33 +0100 Subject: [PATCH] Enhance user statistics reporting in broadcast.js - Updated the command table to include the last login timestamp for each user, providing more detailed insights into user engagement. - Modified the structure of the statistics display to improve clarity and usefulness of the data presented. These changes enhance the depth of user engagement statistics and improve overall reporting accuracy. --- server/broadcast.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/broadcast.js b/server/broadcast.js index 3ed8e3a..0d0ffee 100644 --- a/server/broadcast.js +++ b/server/broadcast.js @@ -473,8 +473,13 @@ export function setupBroadcast(io, __dirname) { sendCommandTable( socket, `Statistik: Namen (gesamt verschieden: ${new Set(records.map((r) => r.userName)).size})`, - ['Name', 'Anzahl'], - topNames.map(([name, count]) => [name, count]) + ['Name', 'Anzahl', 'Letzter Login'], + topNames.map(([name, count]) => { + const latestRecord = records + .filter((r) => r.userName === name) + .sort((a, b) => b.date - a.date)[0]; + return [name, count, latestRecord ? latestRecord.timestamp : '-']; + }) ); return; }