From 2f6b1e959b3be5c2b44d68271fb719dedb188590 Mon Sep 17 00:00:00 2001 From: Phil Winder Date: Mon, 8 May 2023 10:55:57 +0100 Subject: [PATCH] feat(ui): add resources for analytics to show pagination * add links to pages in dash --- ui/src/Analytics.tsx | 19 +++++++++++++++++++ ui/src/App.tsx | 7 +++++++ ui/src/Dashboard.tsx | 18 +++++++++++++++++- 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 ui/src/Analytics.tsx diff --git a/ui/src/Analytics.tsx b/ui/src/Analytics.tsx new file mode 100644 index 0000000..a05ff80 --- /dev/null +++ b/ui/src/Analytics.tsx @@ -0,0 +1,19 @@ +import { Datagrid, List, NumberField, TextField } from "react-admin"; + +export const ContentList = () => ( + } sort={{ field: 'meta.count', order: 'DESC' }}> + + + + + +); + +export const RecentResultList = () => ( + } sort={{ field: 'meta.created_at', order: 'DESC' }}> + + + + + +); diff --git a/ui/src/App.tsx b/ui/src/App.tsx index e9d6981..3de9dcb 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -1,6 +1,10 @@ import AccountTreeIcon from '@mui/icons-material/AccountTree'; +import FindInPageIcon from '@mui/icons-material/FindInPage'; +import ImageSearchIcon from '@mui/icons-material/ImageSearch'; +import ShortTextIcon from '@mui/icons-material/ShortText'; import WorkIcon from '@mui/icons-material/Work'; import { Admin, Resource, ShowGuesser, defaultTheme } from "react-admin"; +import { ContentList, RecentResultList } from './Analytics'; import Dashboard from './Dashboard'; import { GraphList } from './Graph'; import { JobList } from './Jobs'; @@ -28,6 +32,9 @@ const App = () => ( + + + ); export default App; diff --git a/ui/src/Dashboard.tsx b/ui/src/Dashboard.tsx index 899a57c..1b8d1ad 100644 --- a/ui/src/Dashboard.tsx +++ b/ui/src/Dashboard.tsx @@ -4,7 +4,7 @@ import CardActions from '@mui/material/CardActions'; import CardContent from '@mui/material/CardContent'; import Grid from '@mui/material/Grid'; import Typography from '@mui/material/Typography'; -import { Datagrid, List, NumberField, Resource, TextField, Title, useGetList } from 'react-admin'; +import { Datagrid, List, NumberField, Resource, TextField, Title, useGetList , ReferenceField, UrlField} from 'react-admin'; import { ResponsiveLine } from '@nivo/line' import logoUrl from './assets/amplify_logo_text.svg' import Box from '@mui/material/Box'; @@ -77,6 +77,11 @@ export default () => { + + + + + @@ -90,6 +95,11 @@ export default () => { + + + + + @@ -133,6 +143,12 @@ export default () => { + + + + + +