fix(inbounds): correct per-inbound client counts and align stat colors

The client column under-counted clients attached to an inbound whose shared client_traffics row is keyed to a different inbound: rollupClients filtered settings.clients down to emails that had a stat row on that inbound. Count from settings.clients membership instead. Also surface all/active/disable/depleted/online with the Clients-page color scheme and widen the column.
This commit is contained in:
MHSanaei
2026-06-01 08:15:44 +02:00
parent 44a8c94108
commit d2058f07dd
2 changed files with 17 additions and 23 deletions
+1 -8
View File
@@ -142,14 +142,7 @@ export function useInbounds() {
const clientStats = Array.isArray((dbInbound as { clientStats?: unknown }).clientStats)
? (dbInbound as unknown as { clientStats: { email: string; total: number; up: number; down: number; expiryTime: number }[] }).clientStats
: [];
const allClients = inbound?.clients || [];
const statsEmails = new Set<string>();
for (const s of clientStats) {
if (s && s.email) statsEmails.add(s.email);
}
const clients = clientStats.length > 0
? allClients.filter((c) => c && c.email && statsEmails.has(c.email))
: allClients;
const clients = inbound?.clients || [];
const active: string[] = [];
const deactive: string[] = [];
const depleted: string[] = [];