Report anzeige für auto-reports verbessert

This commit is contained in:
PxlLoewe
2026-02-08 21:37:10 +01:00
parent b46ad25bde
commit 5d0a36f967
5 changed files with 107 additions and 46 deletions

View File

@@ -47,30 +47,42 @@ export const AccountLog = ({ sameIPLogs, userId }: { sameIPLogs: Log[]; userId:
</div>
}
getFilter={(searchTerm) => {
return {
AND: [
onlyImportant
? {
type: {
in: ["REGISTER", "PROFILE_CHANGE"],
},
}
: {},
{
AND: [
{ ip: { contains: searchTerm } },
{ browser: { contains: searchTerm } },
{
id: {
in: sameIPLogs
.filter((log) => log.id.toString().includes(searchTerm))
.map((log) => log.id),
},
if (onlyImportant) {
return {
AND: [
{ ip: { contains: searchTerm } },
{ browser: { contains: searchTerm } },
{
id: {
in: sameIPLogs
.filter((log) => log.id.toString().includes(searchTerm))
.map((log) => log.id),
},
],
},
],
} as Prisma.LogWhereInput;
},
],
} as Prisma.LogWhereInput;
} else {
return {
OR: [
{
AND: [
{ ip: { contains: searchTerm } },
{ browser: { contains: searchTerm } },
{
id: {
in: sameIPLogs
.filter((log) => log.id.toString().includes(searchTerm))
.map((log) => log.id),
},
},
],
},
{
userId: userId,
},
],
} as Prisma.LogWhereInput;
}
}}
include={{
User: true,