-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into chore/setup-wizard-step-four
- Loading branch information
Showing
8 changed files
with
76 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@rocket.chat/meteor": patch | ||
--- | ||
|
||
Changed the name of the administration Logs page to "Records", implemented a tab layout in this page and added a new tab called "Analytic reports" that shows the most recent result of the statistics endpoint. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
apps/meteor/client/views/admin/viewLogs/AnalyticsReports.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Box, Icon, Skeleton } from '@rocket.chat/fuselage'; | ||
import { useTranslation } from '@rocket.chat/ui-contexts'; | ||
import React from 'react'; | ||
|
||
import { useAnalyticsObject } from './hooks/useAnalyticsObject'; | ||
|
||
const AnalyticsReports = () => { | ||
const t = useTranslation(); | ||
|
||
const { data, isLoading, isSuccess, isError } = useAnalyticsObject(); | ||
|
||
return ( | ||
<> | ||
<Box p={20} pbe={28} mbe={24}> | ||
<Box display='flex' flexDirection='row' alignItems='center' mbe={20}> | ||
<Box display='flex' justifyContent='center' alignItems='center' borderRadius={2} p={4} mie={8} bg='status-background-info'> | ||
<Icon name='info' size={20} color='info' /> | ||
</Box> | ||
<Box fontScale='h4'>{t('How_and_why_we_collect_usage_data')}</Box> | ||
</Box> | ||
<Box fontScale='p1'>{t('Analytics_page_briefing')}</Box> | ||
</Box> | ||
<Box display='flex' flexDirection='column' padding={8} flexGrow={1} color='default' bg='neutral' borderRadius={4} overflow='scroll'> | ||
{isSuccess && <pre>{JSON.stringify(data, null, '\t')}</pre>} | ||
{isError && t('Something_went_wrong_try_again_later')} | ||
{isLoading && ( | ||
<> | ||
<Skeleton /> | ||
<Skeleton /> | ||
<Skeleton /> | ||
</> | ||
)} | ||
</Box> | ||
</> | ||
); | ||
}; | ||
|
||
export default AnalyticsReports; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
apps/meteor/client/views/admin/viewLogs/hooks/useAnalyticsObject.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { useEndpoint } from '@rocket.chat/ui-contexts'; | ||
import { useQuery } from '@tanstack/react-query'; | ||
|
||
export const useAnalyticsObject = () => { | ||
const getAnalytics = useEndpoint('GET', '/v1/statistics'); | ||
|
||
return useQuery(['analytics'], () => getAnalytics({}), { staleTime: 10 * 60 * 1000 }); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters