fix logs
This commit is contained in:
@@ -34,6 +34,7 @@ export class UserService {
|
|||||||
systemLogins: 0,
|
systemLogins: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (logs.length > 1) {
|
||||||
const current = first;
|
const current = first;
|
||||||
while (current <= last) {
|
while (current <= last) {
|
||||||
current.setDate(current.getDate() + 1);
|
current.setDate(current.getDate() + 1);
|
||||||
@@ -42,7 +43,6 @@ export class UserService {
|
|||||||
systemLogins: 0,
|
systemLogins: 0,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
logs.forEach((l) => {
|
logs.forEach((l) => {
|
||||||
if (l.type == 'login') {
|
if (l.type == 'login') {
|
||||||
res[l.timestamp.toISOString().substring(0, 10)].logins += 1;
|
res[l.timestamp.toISOString().substring(0, 10)].logins += 1;
|
||||||
@@ -50,6 +50,7 @@ export class UserService {
|
|||||||
res[l.timestamp.toISOString().substring(0, 10)].systemLogins += 1;
|
res[l.timestamp.toISOString().substring(0, 10)].systemLogins += 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return Object.entries(res).map(([date, count]) => ({
|
return Object.entries(res).map(([date, count]) => ({
|
||||||
date: new Date(date),
|
date: new Date(date),
|
||||||
|
|||||||
Reference in New Issue
Block a user