mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
add RealtimeData to types
Some checks failed
Node.js CI / build (postgresql, 18.18, 10) (push) Has been cancelled
Some checks failed
Node.js CI / build (postgresql, 18.18, 10) (push) Has been cancelled
This commit is contained in:
parent
30781430c5
commit
bf498d9239
2 changed files with 21 additions and 20 deletions
|
|
@ -1,25 +1,6 @@
|
||||||
import { REALTIME_INTERVAL } from '@/lib/constants';
|
import { REALTIME_INTERVAL } from '@/lib/constants';
|
||||||
import { useApi } from '../useApi';
|
import { useApi } from '../useApi';
|
||||||
|
import { RealtimeData } from '@/lib/types';
|
||||||
export interface RealtimeData {
|
|
||||||
countries: Record<string, number>;
|
|
||||||
events: any[];
|
|
||||||
pageviews: any[];
|
|
||||||
referrers: Record<string, number>;
|
|
||||||
timestamp: number;
|
|
||||||
series: {
|
|
||||||
views: any[];
|
|
||||||
visitors: any[];
|
|
||||||
};
|
|
||||||
totals: {
|
|
||||||
views: number;
|
|
||||||
visitors: number;
|
|
||||||
events: number;
|
|
||||||
countries: number;
|
|
||||||
};
|
|
||||||
urls: Record<string, number>;
|
|
||||||
visitors: any[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export function useRealtimeQuery(websiteId: string) {
|
export function useRealtimeQuery(websiteId: string) {
|
||||||
const { get, useQuery } = useApi();
|
const { get, useQuery } = useApi();
|
||||||
|
|
|
||||||
|
|
@ -116,3 +116,23 @@ export interface PageResult<T> {
|
||||||
sortDescending?: boolean;
|
sortDescending?: boolean;
|
||||||
search?: string;
|
search?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface RealtimeData {
|
||||||
|
countries: Record<string, number>;
|
||||||
|
events: any[];
|
||||||
|
pageviews: any[];
|
||||||
|
referrers: Record<string, number>;
|
||||||
|
timestamp: number;
|
||||||
|
series: {
|
||||||
|
views: any[];
|
||||||
|
visitors: any[];
|
||||||
|
};
|
||||||
|
totals: {
|
||||||
|
views: number;
|
||||||
|
visitors: number;
|
||||||
|
events: number;
|
||||||
|
countries: number;
|
||||||
|
};
|
||||||
|
urls: Record<string, number>;
|
||||||
|
visitors: any[];
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue