Add ip address to csv
This commit is contained in:
parent
b8b2778b69
commit
3b390f758f
|
@ -56,18 +56,20 @@ function UsersTable() {
|
||||||
return {
|
return {
|
||||||
email: privateUsersById[user.id]?.email,
|
email: privateUsersById[user.id]?.email,
|
||||||
profit: profitByUser[user.id] ?? 0,
|
profit: profitByUser[user.id] ?? 0,
|
||||||
|
ip: privateUsersById[user.id]?.initialIpAddress,
|
||||||
...user,
|
...user,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.sort((a, b) => b.createdTime - a.createdTime)
|
.sort((a, b) => b.createdTime - a.createdTime)
|
||||||
|
|
||||||
function exportCsv() {
|
function exportCsv() {
|
||||||
const lines = [['Email', 'Name', 'Balance', 'Profit']].concat(
|
const lines = [['Email', 'Name', 'Balance', 'Profit', 'IP Address']].concat(
|
||||||
fullUsers.map((u) => [
|
fullUsers.map((u) => [
|
||||||
u.email ?? '',
|
u.email ?? '',
|
||||||
u.name,
|
u.name,
|
||||||
Math.round(u.balance).toString(),
|
Math.round(u.balance).toString(),
|
||||||
Math.round(profitByUser[u.id] ?? 0).toString(),
|
Math.round(profitByUser[u.id] ?? 0).toString(),
|
||||||
|
u.ip ?? '',
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
const csv = lines.map((line) => line.join(', ')).join('\n')
|
const csv = lines.map((line) => line.join(', ')).join('\n')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user