From 8f353679bb29f80eb69dca76fd096a980aca4270 Mon Sep 17 00:00:00 2001 From: Josue Date: Wed, 19 May 2021 18:23:55 -0400 Subject: [PATCH] feat: add server page and boilerplate code for the components --- striker-ui/components/Display.tsx | 12 +++++ striker-ui/components/Domain.tsx | 12 +++++ striker-ui/components/Resource.tsx | 12 +++++ striker-ui/pages/server.tsx | 72 ++++++++++++++++++++++++++++++ 4 files changed, 108 insertions(+) create mode 100644 striker-ui/components/Display.tsx create mode 100644 striker-ui/components/Domain.tsx create mode 100644 striker-ui/components/Resource.tsx create mode 100644 striker-ui/pages/server.tsx diff --git a/striker-ui/components/Display.tsx b/striker-ui/components/Display.tsx new file mode 100644 index 00000000..0c2f5495 --- /dev/null +++ b/striker-ui/components/Display.tsx @@ -0,0 +1,12 @@ +import { Panel } from './Panels'; +import { HeaderText } from './Text'; + +const Display = (): JSX.Element => { + return ( + + + + ); +}; + +export default Display; diff --git a/striker-ui/components/Domain.tsx b/striker-ui/components/Domain.tsx new file mode 100644 index 00000000..c25ff26e --- /dev/null +++ b/striker-ui/components/Domain.tsx @@ -0,0 +1,12 @@ +import { Panel } from './Panels'; +import { HeaderText } from './Text'; + +const Domain = (): JSX.Element => { + return ( + + + + ); +}; + +export default Domain; diff --git a/striker-ui/components/Resource.tsx b/striker-ui/components/Resource.tsx new file mode 100644 index 00000000..52816d41 --- /dev/null +++ b/striker-ui/components/Resource.tsx @@ -0,0 +1,12 @@ +import { Panel } from './Panels'; +import { HeaderText } from './Text'; + +const Resource = (): JSX.Element => { + return ( + + + + ); +}; + +export default Resource; diff --git a/striker-ui/pages/server.tsx b/striker-ui/pages/server.tsx new file mode 100644 index 00000000..fe917cf3 --- /dev/null +++ b/striker-ui/pages/server.tsx @@ -0,0 +1,72 @@ +import { Box } from '@material-ui/core'; +import { makeStyles } from '@material-ui/core/styles'; + +import CPU from '../components/CPU'; +import Memory from '../components/Memory'; +import Resource from '../components/Resource'; +import PeriodicFetch from '../lib/fetchers/periodicFetch'; +import Display from '../components/Display'; +import Header from '../components/Header'; +import Domain from '../components/Domain'; + +const useStyles = makeStyles((theme) => ({ + child: { + width: '22%', + height: '100%', + [theme.breakpoints.down('lg')]: { + width: '25%', + }, + [theme.breakpoints.down('md')]: { + width: '100%', + }, + }, + server: { + width: '35%', + [theme.breakpoints.down('lg')]: { + width: '25%', + }, + [theme.breakpoints.down('md')]: { + width: '100%', + }, + }, + container: { + display: 'flex', + flexDirection: 'row', + width: '100%', + justifyContent: 'space-between', + [theme.breakpoints.down('md')]: { + display: 'block', + }, + }, +})); + +const Home = (): JSX.Element => { + const classes = useStyles(); + + const { data } = PeriodicFetch( + `${process.env.NEXT_PUBLIC_API_URL}/anvils/get_anvils`, + ); + + return ( + <> +
+ {data?.anvils && ( + + + + + + + + + + + + + + )} + + ); +}; + +export default Home;