@nextjscms/plugin-google-analytics 2.1.35 → 2.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/dist/client/components/BounceRate.d.ts +0 -5
- package/dist/client/components/BounceRate.d.ts.map +0 -1
- package/dist/client/components/BounceRate.js +0 -55
- package/dist/client/components/LivePageViews.d.ts +0 -2
- package/dist/client/components/LivePageViews.d.ts.map +0 -1
- package/dist/client/components/LivePageViews.js +0 -21
- package/dist/client/components/LiveUsersCount.d.ts +0 -2
- package/dist/client/components/LiveUsersCount.d.ts.map +0 -1
- package/dist/client/components/LiveUsersCount.js +0 -22
- package/dist/client/components/MonthlyPageViews.d.ts +0 -5
- package/dist/client/components/MonthlyPageViews.d.ts.map +0 -1
- package/dist/client/components/MonthlyPageViews.js +0 -24
- package/dist/client/components/TopCountries.d.ts +0 -5
- package/dist/client/components/TopCountries.d.ts.map +0 -1
- package/dist/client/components/TopCountries.js +0 -26
- package/dist/client/components/TopDevices.d.ts +0 -5
- package/dist/client/components/TopDevices.d.ts.map +0 -1
- package/dist/client/components/TopDevices.js +0 -26
- package/dist/client/components/TopMediums.d.ts +0 -5
- package/dist/client/components/TopMediums.d.ts.map +0 -1
- package/dist/client/components/TopMediums.js +0 -38
- package/dist/client/components/TopSources.d.ts +0 -5
- package/dist/client/components/TopSources.d.ts.map +0 -1
- package/dist/client/components/TopSources.js +0 -26
- package/dist/client/components/TotalPageViews.d.ts +0 -5
- package/dist/client/components/TotalPageViews.d.ts.map +0 -1
- package/dist/client/components/TotalPageViews.js +0 -24
- package/dist/client/components/TotalSessions.d.ts +0 -5
- package/dist/client/components/TotalSessions.d.ts.map +0 -1
- package/dist/client/components/TotalSessions.js +0 -24
- package/dist/client/components/TotalUniqueUsers.d.ts +0 -5
- package/dist/client/components/TotalUniqueUsers.d.ts.map +0 -1
- package/dist/client/components/TotalUniqueUsers.js +0 -24
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextjscms/plugin-google-analytics",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.37",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"react": "19.2.3",
|
|
27
27
|
"react-dom": "19.2.3",
|
|
28
|
-
"nextjs-cms": "0.9.
|
|
28
|
+
"nextjs-cms": "0.9.37"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/react": "^19.2.7",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BounceRate.d.ts","sourceRoot":"","sources":["../../../src/client/components/BounceRate.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,UAAU,GAAI,sBAAsB;IAAE,QAAQ,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;CAAE,4CA2DhH,CAAA"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useI18n } from 'nextjs-cms/translations/client';
|
|
3
|
-
import { formatNumber } from 'nextjs-cms/utils';
|
|
4
|
-
import PieChartBox from '@/components/PieChartBox';
|
|
5
|
-
import { useEffect } from 'react';
|
|
6
|
-
import { useQuery } from '@tanstack/react-query';
|
|
7
|
-
import { getAnalytics } from '@/lib/apiHelpers';
|
|
8
|
-
import { useAxiosPrivate } from 'nextjs-cms/api/client';
|
|
9
|
-
import { useTheme } from 'next-themes';
|
|
10
|
-
export const BounceRate = ({ fromDate, toDate }) => {
|
|
11
|
-
const t = useI18n();
|
|
12
|
-
const axiosPrivate = useAxiosPrivate();
|
|
13
|
-
let controller = new AbortController();
|
|
14
|
-
const { theme } = useTheme();
|
|
15
|
-
const { isLoading, isError, data, error } = useQuery({
|
|
16
|
-
queryKey: ['analyticsPage', 'statistics', fromDate, toDate],
|
|
17
|
-
queryFn: () => {
|
|
18
|
-
// Abort the previous request
|
|
19
|
-
controller.abort();
|
|
20
|
-
// Create a new AbortController for the new request
|
|
21
|
-
controller = new AbortController();
|
|
22
|
-
return getAnalytics({
|
|
23
|
-
requestType: 'statistics',
|
|
24
|
-
axiosPrivate,
|
|
25
|
-
controller,
|
|
26
|
-
fromDate,
|
|
27
|
-
toDate,
|
|
28
|
-
});
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
const bounceRateData = [
|
|
32
|
-
{
|
|
33
|
-
name: t('totalDiskSpace'),
|
|
34
|
-
value: 100 - parseInt(data?.bounceRate),
|
|
35
|
-
fill: 'transparent',
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: t('usedDiskSpace'),
|
|
39
|
-
value: parseInt(data?.bounceRate),
|
|
40
|
-
fill: theme === 'dark' ? '#adfa1d' : '#E1315B',
|
|
41
|
-
},
|
|
42
|
-
];
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
return () => {
|
|
45
|
-
controller.abort();
|
|
46
|
-
};
|
|
47
|
-
}, []);
|
|
48
|
-
return (_jsx(PieChartBox, { height: 250, legend: false, chartData: bounceRateData, isLoading: isLoading, chartBoxTitles: {
|
|
49
|
-
mainTitle: t('bounceRate'),
|
|
50
|
-
totalUnitSubtitle: {
|
|
51
|
-
key: t('sessionsPerUser'),
|
|
52
|
-
value: formatNumber(data?.sessionsPerUser),
|
|
53
|
-
},
|
|
54
|
-
} }));
|
|
55
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LivePageViews.d.ts","sourceRoot":"","sources":["../../../src/client/components/LivePageViews.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,aAAa,+CA8CzB,CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useI18n } from 'nextjs-cms/translations/client';
|
|
3
|
-
import { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
|
|
4
|
-
import ContainerBox from '@/components/ContainerBox';
|
|
5
|
-
import { useAxiosPrivate } from 'nextjs-cms/api/client';
|
|
6
|
-
import { useQuery } from '@tanstack/react-query';
|
|
7
|
-
import { getAnalytics } from '@/lib/apiHelpers';
|
|
8
|
-
export const LivePageViews = () => {
|
|
9
|
-
const t = useI18n();
|
|
10
|
-
const axiosPrivate = useAxiosPrivate();
|
|
11
|
-
const controller = new AbortController();
|
|
12
|
-
const { isLoading, isError, data, error } = useQuery({
|
|
13
|
-
queryKey: ['analyticsPage', 'livePageViews'],
|
|
14
|
-
queryFn: () => getAnalytics({
|
|
15
|
-
requestType: 'livePageViews',
|
|
16
|
-
axiosPrivate,
|
|
17
|
-
controller,
|
|
18
|
-
}),
|
|
19
|
-
});
|
|
20
|
-
return (_jsx(ContainerBox, { title: t('liveUsersAreViewing'), children: _jsxs(Table, { children: [_jsx(TableCaption, { children: t('liveUsersSubtitle') }), _jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: t('country') }), _jsx(TableHead, { children: t('device') }), _jsx(TableHead, { children: t('page') })] }) }), _jsx(TableBody, { children: data?.livePageViews?.locations?.length > 0 ? (data.livePageViews.locations.map((location, index) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: location.country }), _jsx(TableCell, { children: location.device }), _jsx(TableCell, { children: location.page })] }, index)))) : (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: 3, className: 'text-center', children: t('noLiveUsers') }) })) })] }) }));
|
|
21
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LiveUsersCount.d.ts","sourceRoot":"","sources":["../../../src/client/components/LiveUsersCount.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,cAAc,+CAuB1B,CAAA"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useI18n } from 'nextjs-cms/translations/client';
|
|
3
|
-
import { formatNumber } from 'nextjs-cms/utils';
|
|
4
|
-
import ContainerBox from '@/components/ContainerBox';
|
|
5
|
-
import { useAxiosPrivate } from 'nextjs-cms/api/client';
|
|
6
|
-
import { useQuery } from '@tanstack/react-query';
|
|
7
|
-
import { getAnalytics } from '@/lib/apiHelpers';
|
|
8
|
-
import LoadingSpinners from '@/components/LoadingSpinners';
|
|
9
|
-
export const LiveUsersCount = () => {
|
|
10
|
-
const t = useI18n();
|
|
11
|
-
const axiosPrivate = useAxiosPrivate();
|
|
12
|
-
const controller = new AbortController();
|
|
13
|
-
const { isLoading, isError, data, error } = useQuery({
|
|
14
|
-
queryKey: ['analyticsPage', 'liveUsersCount'],
|
|
15
|
-
queryFn: () => getAnalytics({
|
|
16
|
-
requestType: 'liveUsersCount',
|
|
17
|
-
axiosPrivate,
|
|
18
|
-
controller,
|
|
19
|
-
}),
|
|
20
|
-
});
|
|
21
|
-
return (_jsx(ContainerBox, { title: t('liveUsers'), children: isLoading ? (_jsx(LoadingSpinners, { single: true })) : (_jsx("div", { className: 'text-4xl', children: formatNumber(data?.liveUsers?.count) })) }));
|
|
22
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MonthlyPageViews.d.ts","sourceRoot":"","sources":["../../../src/client/components/MonthlyPageViews.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,gBAAgB,GAAI,uBAG9B;IACC,QAAQ,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAC9B,MAAM,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;CAC/B,4CA2BA,CAAA"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useI18n } from 'nextjs-cms/translations/client';
|
|
3
|
-
import BarChartBox from '@/components/BarChartBox';
|
|
4
|
-
import { useTheme } from 'next-themes';
|
|
5
|
-
import { useQuery } from '@tanstack/react-query';
|
|
6
|
-
import { getAnalytics } from '@/lib/apiHelpers';
|
|
7
|
-
import { useAxiosPrivate } from 'nextjs-cms/api/client';
|
|
8
|
-
export const MonthlyPageViews = ({ fromDate, toDate, }) => {
|
|
9
|
-
const t = useI18n();
|
|
10
|
-
const axiosPrivate = useAxiosPrivate();
|
|
11
|
-
const controller = new AbortController();
|
|
12
|
-
const { theme } = useTheme();
|
|
13
|
-
const { isLoading, isError, data, error } = useQuery({
|
|
14
|
-
queryKey: ['analyticsPage', 'monthlyPageViews', fromDate, toDate],
|
|
15
|
-
queryFn: () => getAnalytics({
|
|
16
|
-
requestType: 'monthlyPageViews',
|
|
17
|
-
axiosPrivate,
|
|
18
|
-
controller,
|
|
19
|
-
fromDate,
|
|
20
|
-
toDate,
|
|
21
|
-
}),
|
|
22
|
-
});
|
|
23
|
-
return (_jsx(_Fragment, { children: _jsx(BarChartBox, { isLoading: isLoading, chartData: data?.monthlyPageViews, title: t('monthlyPageViews'), fill: theme === 'dark' ? '#adfa1d' : '#ff6688' }) }));
|
|
24
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TopCountries.d.ts","sourceRoot":"","sources":["../../../src/client/components/TopCountries.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,YAAY,GAAI,uBAG1B;IACC,QAAQ,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAC9B,MAAM,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;CAC/B,4CAkCA,CAAA"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useI18n } from 'nextjs-cms/translations/client';
|
|
3
|
-
import { Badge } from '@/components/ui/badge';
|
|
4
|
-
import { formatNumber } from 'nextjs-cms/utils';
|
|
5
|
-
import ContainerBox from '@/components/ContainerBox';
|
|
6
|
-
import { useAxiosPrivate } from 'nextjs-cms/api/client';
|
|
7
|
-
import { useQuery } from '@tanstack/react-query';
|
|
8
|
-
import { getAnalytics } from '@/lib/apiHelpers';
|
|
9
|
-
import LoadingSpinners from '@/components/LoadingSpinners';
|
|
10
|
-
export const TopCountries = ({ fromDate, toDate, }) => {
|
|
11
|
-
const t = useI18n();
|
|
12
|
-
const axiosPrivate = useAxiosPrivate();
|
|
13
|
-
const controller = new AbortController();
|
|
14
|
-
const { isLoading, isError, data, error } = useQuery({
|
|
15
|
-
queryKey: ['analyticsPage', 'topCountries', fromDate, toDate],
|
|
16
|
-
queryFn: () => getAnalytics({
|
|
17
|
-
requestType: 'topCountries',
|
|
18
|
-
axiosPrivate,
|
|
19
|
-
controller,
|
|
20
|
-
fromDate,
|
|
21
|
-
toDate,
|
|
22
|
-
}),
|
|
23
|
-
});
|
|
24
|
-
return (_jsx(ContainerBox, { title: t('countries'), children: _jsxs("div", { className: 'w-full mb-6', children: [_jsx("h1", { className: 'font-bold border-b pb-1 my-1', children: t('topCountries') }), isLoading && _jsx(LoadingSpinners, { single: true }), data?.topCountries?.length > 0 &&
|
|
25
|
-
data.topCountries.map((country, index) => (_jsxs("div", { className: 'w-full text-sm flex justify-between', children: [_jsxs("span", { className: 'font-bold text-foreground', children: [country.name, ":"] }), _jsx(Badge, { variant: 'outline', className: 'ms-2', children: formatNumber(country.value) })] }, `${index}-${country.name}`)))] }) }));
|
|
26
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TopDevices.d.ts","sourceRoot":"","sources":["../../../src/client/components/TopDevices.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU,GAAI,sBAAsB;IAAE,QAAQ,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;CAAE,4CAkChH,CAAA"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useI18n } from 'nextjs-cms/translations/client';
|
|
3
|
-
import { Badge } from '@/components/ui/badge';
|
|
4
|
-
import { formatNumber } from 'nextjs-cms/utils';
|
|
5
|
-
import ContainerBox from '@/components/ContainerBox';
|
|
6
|
-
import { useAxiosPrivate } from 'nextjs-cms/api/client';
|
|
7
|
-
import { useQuery } from '@tanstack/react-query';
|
|
8
|
-
import { getAnalytics } from '@/lib/apiHelpers';
|
|
9
|
-
import LoadingSpinners from '@/components/LoadingSpinners';
|
|
10
|
-
export const TopDevices = ({ fromDate, toDate }) => {
|
|
11
|
-
const t = useI18n();
|
|
12
|
-
const axiosPrivate = useAxiosPrivate();
|
|
13
|
-
const controller = new AbortController();
|
|
14
|
-
const { isLoading, isError, data, error } = useQuery({
|
|
15
|
-
queryKey: ['analyticsPage', 'topDevices', fromDate, toDate],
|
|
16
|
-
queryFn: () => getAnalytics({
|
|
17
|
-
requestType: 'topDevices',
|
|
18
|
-
axiosPrivate,
|
|
19
|
-
controller,
|
|
20
|
-
fromDate,
|
|
21
|
-
toDate,
|
|
22
|
-
}),
|
|
23
|
-
});
|
|
24
|
-
return (_jsx(ContainerBox, { title: t('devices'), children: _jsxs("div", { className: 'w-full', children: [_jsx("h1", { className: 'font-bold border-b pb-1 my-1', children: t('topDevices') }), isLoading && _jsx(LoadingSpinners, { single: true }), data?.topDevices?.length > 0 &&
|
|
25
|
-
data.topDevices.map((device, index) => (_jsxs("div", { className: 'w-full text-sm flex justify-between', children: [_jsxs("span", { className: 'font-bold text-foreground', children: [device.name, ":"] }), _jsx(Badge, { variant: 'outline', className: 'ms-2', children: formatNumber(device.value) })] }, `${index}-${device.name}`)))] }) }));
|
|
26
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TopMediums.d.ts","sourceRoot":"","sources":["../../../src/client/components/TopMediums.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU,GAAI,sBAAsB;IAAE,QAAQ,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;CAAE,4CA8ChH,CAAA"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useI18n } from 'nextjs-cms/translations/client';
|
|
3
|
-
import { Badge } from '@/components/ui/badge';
|
|
4
|
-
import { formatNumber } from 'nextjs-cms/utils';
|
|
5
|
-
import ContainerBox from '@/components/ContainerBox';
|
|
6
|
-
import { useEffect } from 'react';
|
|
7
|
-
import { useAxiosPrivate } from 'nextjs-cms/api/client';
|
|
8
|
-
import { useQuery } from '@tanstack/react-query';
|
|
9
|
-
import { getAnalytics } from '@/lib/apiHelpers';
|
|
10
|
-
import LoadingSpinners from '@/components/LoadingSpinners';
|
|
11
|
-
export const TopMediums = ({ fromDate, toDate }) => {
|
|
12
|
-
const t = useI18n();
|
|
13
|
-
const axiosPrivate = useAxiosPrivate();
|
|
14
|
-
let controller = new AbortController();
|
|
15
|
-
const { isLoading, isError, data, error } = useQuery({
|
|
16
|
-
queryKey: ['analyticsPage', 'topMediums', fromDate, toDate],
|
|
17
|
-
queryFn: () => {
|
|
18
|
-
// Abort the previous request
|
|
19
|
-
controller.abort();
|
|
20
|
-
// Create a new AbortController for the new request
|
|
21
|
-
controller = new AbortController();
|
|
22
|
-
return getAnalytics({
|
|
23
|
-
requestType: 'topMediums',
|
|
24
|
-
axiosPrivate,
|
|
25
|
-
controller,
|
|
26
|
-
fromDate,
|
|
27
|
-
toDate,
|
|
28
|
-
});
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
return () => {
|
|
33
|
-
controller.abort();
|
|
34
|
-
};
|
|
35
|
-
}, []);
|
|
36
|
-
return (_jsx(ContainerBox, { title: t('mediums'), children: _jsxs("div", { className: 'w-full mb-6', children: [_jsx("h1", { className: 'font-bold border-b pb-1 my-1', children: t('topMediums') }), isLoading && _jsx(LoadingSpinners, { single: true }), data?.topMediums?.length > 0 &&
|
|
37
|
-
data.topMediums.map((medium, index) => (_jsxs("div", { className: 'w-full text-sm flex justify-between', children: [_jsxs("span", { className: 'font-bold text-foreground', children: [medium.name, ":"] }), _jsx(Badge, { variant: 'outline', className: 'ms-2', children: formatNumber(medium.value) })] }, `${index}-${medium.name}`)))] }) }));
|
|
38
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TopSources.d.ts","sourceRoot":"","sources":["../../../src/client/components/TopSources.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU,GAAI,sBAAsB;IAAE,QAAQ,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;CAAE,4CAiChH,CAAA"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useI18n } from 'nextjs-cms/translations/client';
|
|
3
|
-
import { Badge } from '@/components/ui/badge';
|
|
4
|
-
import { formatNumber } from 'nextjs-cms/utils';
|
|
5
|
-
import ContainerBox from '@/components/ContainerBox';
|
|
6
|
-
import { useAxiosPrivate } from 'nextjs-cms/api/client';
|
|
7
|
-
import { useQuery } from '@tanstack/react-query';
|
|
8
|
-
import { getAnalytics } from '@/lib/apiHelpers';
|
|
9
|
-
import LoadingSpinners from '@/components/LoadingSpinners';
|
|
10
|
-
export const TopSources = ({ fromDate, toDate }) => {
|
|
11
|
-
const t = useI18n();
|
|
12
|
-
const axiosPrivate = useAxiosPrivate();
|
|
13
|
-
const controller = new AbortController();
|
|
14
|
-
const { isLoading, isError, data, error } = useQuery({
|
|
15
|
-
queryKey: ['analyticsPage', 'topSources', fromDate, toDate],
|
|
16
|
-
queryFn: () => getAnalytics({
|
|
17
|
-
requestType: 'topSources',
|
|
18
|
-
axiosPrivate,
|
|
19
|
-
controller,
|
|
20
|
-
fromDate,
|
|
21
|
-
toDate,
|
|
22
|
-
}),
|
|
23
|
-
});
|
|
24
|
-
return (_jsx(ContainerBox, { title: t('sources'), children: _jsxs("div", { className: 'w-full mb-6', children: [_jsx("h1", { className: 'font-bold border-b pb-1 my-1', children: t('topSources') }), isLoading && _jsx(LoadingSpinners, { single: true }), data?.topSources?.length > 0 &&
|
|
25
|
-
data.topSources.map((source, index) => (_jsxs("div", { className: 'w-full text-sm flex justify-between', children: [_jsxs("span", { className: 'font-bold text-foreground', children: [source.name, ":"] }), _jsx(Badge, { variant: 'outline', className: 'ms-2', children: formatNumber(source.value) })] }, `${index}-${source.name}`)))] }) }));
|
|
26
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TotalPageViews.d.ts","sourceRoot":"","sources":["../../../src/client/components/TotalPageViews.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,cAAc,GAAI,uBAG5B;IACC,QAAQ,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAC9B,MAAM,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;CAC/B,4CAyBA,CAAA"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useI18n } from 'nextjs-cms/translations/client';
|
|
3
|
-
import { formatNumber } from 'nextjs-cms/utils';
|
|
4
|
-
import ContainerBox from '@/components/ContainerBox';
|
|
5
|
-
import { useAxiosPrivate } from 'nextjs-cms/api/client';
|
|
6
|
-
import { useQuery } from '@tanstack/react-query';
|
|
7
|
-
import { getAnalytics } from '@/lib/apiHelpers';
|
|
8
|
-
import LoadingSpinners from '@/components/LoadingSpinners';
|
|
9
|
-
export const TotalPageViews = ({ fromDate, toDate, }) => {
|
|
10
|
-
const t = useI18n();
|
|
11
|
-
const axiosPrivate = useAxiosPrivate();
|
|
12
|
-
const controller = new AbortController();
|
|
13
|
-
const { isLoading, isError, data, error } = useQuery({
|
|
14
|
-
queryKey: ['analyticsPage', 'statistics', fromDate, toDate],
|
|
15
|
-
queryFn: () => getAnalytics({
|
|
16
|
-
requestType: 'statistics',
|
|
17
|
-
axiosPrivate,
|
|
18
|
-
controller,
|
|
19
|
-
fromDate,
|
|
20
|
-
toDate,
|
|
21
|
-
}),
|
|
22
|
-
});
|
|
23
|
-
return (_jsx(ContainerBox, { title: t('totalPageViews'), children: isLoading ? (_jsx(LoadingSpinners, { single: true })) : (_jsx("div", { className: 'text-4xl', children: formatNumber(data?.totalPageViews) })) }));
|
|
24
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TotalSessions.d.ts","sourceRoot":"","sources":["../../../src/client/components/TotalSessions.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,aAAa,GAAI,uBAG3B;IACC,QAAQ,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAC9B,MAAM,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;CAC/B,4CAyBA,CAAA"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useI18n } from 'nextjs-cms/translations/client';
|
|
3
|
-
import { formatNumber } from 'nextjs-cms/utils';
|
|
4
|
-
import ContainerBox from '@/components/ContainerBox';
|
|
5
|
-
import { useAxiosPrivate } from 'nextjs-cms/api/client';
|
|
6
|
-
import { useQuery } from '@tanstack/react-query';
|
|
7
|
-
import { getAnalytics } from '@/lib/apiHelpers';
|
|
8
|
-
import LoadingSpinners from '@/components/LoadingSpinners';
|
|
9
|
-
export const TotalSessions = ({ fromDate, toDate, }) => {
|
|
10
|
-
const t = useI18n();
|
|
11
|
-
const axiosPrivate = useAxiosPrivate();
|
|
12
|
-
const controller = new AbortController();
|
|
13
|
-
const { isLoading, isError, data, error } = useQuery({
|
|
14
|
-
queryKey: ['analyticsPage', 'statistics', fromDate, toDate],
|
|
15
|
-
queryFn: () => getAnalytics({
|
|
16
|
-
requestType: 'statistics',
|
|
17
|
-
axiosPrivate,
|
|
18
|
-
controller,
|
|
19
|
-
fromDate,
|
|
20
|
-
toDate,
|
|
21
|
-
}),
|
|
22
|
-
});
|
|
23
|
-
return (_jsx(ContainerBox, { title: t('totalSessions'), children: isLoading ? (_jsx(LoadingSpinners, { single: true })) : (_jsx("div", { className: 'text-4xl', children: formatNumber(data?.totalSessions) })) }));
|
|
24
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TotalUniqueUsers.d.ts","sourceRoot":"","sources":["../../../src/client/components/TotalUniqueUsers.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,gBAAgB,GAAI,uBAG9B;IACC,QAAQ,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAC9B,MAAM,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;CAC/B,4CAyBA,CAAA"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useI18n } from 'nextjs-cms/translations/client';
|
|
3
|
-
import { formatNumber } from 'nextjs-cms/utils';
|
|
4
|
-
import ContainerBox from '@/components/ContainerBox';
|
|
5
|
-
import { useAxiosPrivate } from 'nextjs-cms/api/client';
|
|
6
|
-
import { useQuery } from '@tanstack/react-query';
|
|
7
|
-
import { getAnalytics } from '@/lib/apiHelpers';
|
|
8
|
-
import LoadingSpinners from '@/components/LoadingSpinners';
|
|
9
|
-
export const TotalUniqueUsers = ({ fromDate, toDate, }) => {
|
|
10
|
-
const t = useI18n();
|
|
11
|
-
const axiosPrivate = useAxiosPrivate();
|
|
12
|
-
const controller = new AbortController();
|
|
13
|
-
const { isLoading, isError, data, error } = useQuery({
|
|
14
|
-
queryKey: ['analyticsPage', 'statistics', fromDate, toDate],
|
|
15
|
-
queryFn: () => getAnalytics({
|
|
16
|
-
requestType: 'statistics',
|
|
17
|
-
axiosPrivate,
|
|
18
|
-
controller,
|
|
19
|
-
fromDate,
|
|
20
|
-
toDate,
|
|
21
|
-
}),
|
|
22
|
-
});
|
|
23
|
-
return (_jsx(ContainerBox, { title: t('totalUniqueUsers'), children: isLoading ? (_jsx(LoadingSpinners, { single: true })) : (_jsx("div", { className: 'text-4xl', children: formatNumber(data?.totalUniqueUsers) })) }));
|
|
24
|
-
};
|