mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 06:07:17 +01:00
Added session data display.
This commit is contained in:
parent
f32bf0a2e0
commit
b3e6e52473
23 changed files with 239 additions and 34 deletions
|
|
@ -10,9 +10,9 @@ function convertToPastel(hexColor: string, pastelFactor: number = 0.5) {
|
|||
hexColor = hexColor.replace(/^#/, '');
|
||||
|
||||
// Convert hex to RGB
|
||||
let r = parseInt(hexColor.substr(0, 2), 16);
|
||||
let g = parseInt(hexColor.substr(2, 2), 16);
|
||||
let b = parseInt(hexColor.substr(4, 2), 16);
|
||||
let r = parseInt(hexColor.substring(0, 2), 16);
|
||||
let g = parseInt(hexColor.substring(2, 4), 16);
|
||||
let b = parseInt(hexColor.substring(4, 6), 16);
|
||||
|
||||
// Calculate pastel version (mix with white)
|
||||
//const pastelFactor = 0.5; // Adjust this value to control pastel intensity
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ export * from './queries/useRealtime';
|
|||
export * from './queries/useReport';
|
||||
export * from './queries/useReports';
|
||||
export * from './queries/useSessionActivity';
|
||||
export * from './queries/useSessionData';
|
||||
export * from './queries/useWebsiteSession';
|
||||
export * from './queries/useWebsiteSessions';
|
||||
export * from './queries/useShareToken';
|
||||
|
|
|
|||
12
src/components/hooks/queries/useSessionData.ts
Normal file
12
src/components/hooks/queries/useSessionData.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import { useApi } from './useApi';
|
||||
|
||||
export function useSessionData(websiteId: string, sessionId: string) {
|
||||
const { get, useQuery } = useApi();
|
||||
|
||||
return useQuery({
|
||||
queryKey: ['session:data', { websiteId, sessionId }],
|
||||
queryFn: () => {
|
||||
return get(`/sessions/${sessionId}/data`, { websiteId });
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
@ -274,6 +274,7 @@ export const labels = defineMessages({
|
|||
previousYear: { id: 'label.previous-year', defaultMessage: 'Previous year' },
|
||||
lastSeen: { id: 'label.last-seen', defaultMessage: 'Last seen' },
|
||||
firstSeen: { id: 'label.first-seen', defaultMessage: 'First seen' },
|
||||
properties: { id: 'label.properties', defaultMessage: 'Properties' },
|
||||
});
|
||||
|
||||
export const messages = defineMessages({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue