mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Updated realtime data fetch.
This commit is contained in:
parent
04e0b33622
commit
e35c11c3d6
9 changed files with 126 additions and 87 deletions
|
|
@ -10,7 +10,6 @@ import { safeDecodeURI } from 'next-basics';
|
|||
import { useContext, useMemo, useState } from 'react';
|
||||
import { Icon, SearchField, StatusLight, Text } from 'react-basics';
|
||||
import { FixedSizeList } from 'react-window';
|
||||
import thenby from 'thenby';
|
||||
import { WebsiteContext } from '../WebsiteProvider';
|
||||
import styles from './RealtimeLog.module.css';
|
||||
|
||||
|
|
@ -141,15 +140,7 @@ export function RealtimeLog({ data }: { data: RealtimeData }) {
|
|||
return [];
|
||||
}
|
||||
|
||||
const { events, visitors } = data;
|
||||
|
||||
let logs = [
|
||||
...events.map(e => ({
|
||||
__type: e.eventName ? TYPE_EVENT : TYPE_PAGEVIEW,
|
||||
...e,
|
||||
})),
|
||||
...visitors.map(v => ({ __type: TYPE_SESSION, ...v })),
|
||||
].sort(thenby.firstBy('createdAt', -1));
|
||||
let logs = data.events;
|
||||
|
||||
if (search) {
|
||||
logs = logs.filter(({ eventName, urlPath, browser, os, country, device }) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue