android app, extension of stats
All checks were successful
Deploy SingleChat / deploy (push) Successful in 40s

This commit is contained in:
Torsten Schulz (local)
2026-08-10 14:03:34 +02:00
parent 62f5914b04
commit bfe28a25fa
849 changed files with 26 additions and 6 deletions

30
server/broadcast.js Normal file → Executable file
View File

@@ -854,6 +854,12 @@ export function setupBroadcast(io, __dirname) {
'Top 20 Namen (Anzahl, letzter Login)',
topNamesDetail.length > 1200 ? `${topNamesDetail.slice(0, 1197)}` : topNamesDetail
);
const latest30Names = records
.slice()
.sort((a, b) => b.date - a.date)
.slice(0, 30)
.map((record) => record.userName);
push('Letzte 30 Logins (neueste zuerst)', latest30Names.join(', ') || '—');
push('Hinweis', 'Tabellen je Tag/Zeitraum: /stat today | /stat date | /stat range');
return rows;
@@ -928,10 +934,24 @@ export function setupBroadcast(io, __dirname) {
return;
}
const filtered = records.filter((r) => r.day >= from && r.day <= to);
const perDay = aggregateTop(filtered, (r) => r.day, 1000)
.sort((a, b) => a[0].localeCompare(b[0]))
.map(([day, count]) => [day, count]);
sendCommandTable(socket, `Statistik: Zeitraum ${from} bis ${to}`, ['Tag', 'Logins'], perDay);
const recordsByDay = new Map();
for (const record of filtered) {
const dayRecords = recordsByDay.get(record.day) || [];
dayRecords.push(record);
recordsByDay.set(record.day, dayRecords);
}
const perDay = Array.from(recordsByDay.entries())
.sort(([dayA], [dayB]) => dayA.localeCompare(dayB))
.map(([day, dayRecords]) => {
const names = dayRecords
.map((record) => record.userName)
.sort((a, b) => a.localeCompare(b, 'de'));
const namesDisplay = dayRecords.length < 10
? names.join(', ')
: `${names.slice(0, 10).join(', ')}, …`;
return [day, dayRecords.length, namesDisplay];
});
sendCommandTable(socket, `Statistik: Zeitraum ${from} bis ${to}`, ['Tag', 'Logins', 'Namen'], perDay);
return;
}
@@ -1135,7 +1155,7 @@ export function setupBroadcast(io, __dirname) {
return true;
}
if (command === '/stat') {
if (command === '/stat' || command === '/stats') {
executeStatsCommand(socket, client, parts);
return true;
}

0
server/chat-auth.js Normal file → Executable file
View File

0
server/feedback-store.js Normal file → Executable file
View File

0
server/index.js Normal file → Executable file
View File

0
server/routes-seo.js Normal file → Executable file
View File

0
server/routes.js Normal file → Executable file
View File