From 3b390f758fe14b7405cb03d22f619a90471180fe Mon Sep 17 00:00:00 2001 From: James Grugett Date: Sat, 3 Sep 2022 23:52:33 -0500 Subject: [PATCH] Add ip address to csv --- web/pages/admin.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/pages/admin.tsx b/web/pages/admin.tsx index 5fba8649..47e0288c 100644 --- a/web/pages/admin.tsx +++ b/web/pages/admin.tsx @@ -56,18 +56,20 @@ function UsersTable() { return { email: privateUsersById[user.id]?.email, profit: profitByUser[user.id] ?? 0, + ip: privateUsersById[user.id]?.initialIpAddress, ...user, } }) .sort((a, b) => b.createdTime - a.createdTime) function exportCsv() { - const lines = [['Email', 'Name', 'Balance', 'Profit']].concat( + const lines = [['Email', 'Name', 'Balance', 'Profit', 'IP Address']].concat( fullUsers.map((u) => [ u.email ?? '', u.name, Math.round(u.balance).toString(), Math.round(profitByUser[u.id] ?? 0).toString(), + u.ip ?? '', ]) ) const csv = lines.map((line) => line.join(', ')).join('\n')