Skip to content

Commit

Permalink
added empty pages
Browse files Browse the repository at this point in the history
  • Loading branch information
SUN committed Mar 7, 2024
1 parent 17ccf46 commit 6de0add
Show file tree
Hide file tree
Showing 11 changed files with 201 additions and 24 deletions.
3 changes: 2 additions & 1 deletion eventmesh-dashboard-view/src/assets/icons/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import HomeOutlinedIcon from '@mui/icons-material/HomeOutlined';
import AddCircleOutlineOutlinedIcon from '@mui/icons-material/AddCircleOutlineOutlined';

import FoundationIcon from '@mui/icons-material/Foundation';

import { ReactComponent as EventMeshLogoIcon } from './eventmesh-logo.svg';
import { ReactComponent as HomeIcon } from './home.svg';
Expand All @@ -18,6 +18,7 @@ import { ReactComponent as LogsIcon } from './logs.svg';
export const Icons = {
HomeOutlined: HomeOutlinedIcon,
AddCircleOutlineOutlined: AddCircleOutlineOutlinedIcon,
Foundation: FoundationIcon,


EventMeshLogo: EventMeshLogoIcon,
Expand Down
28 changes: 28 additions & 0 deletions eventmesh-dashboard-view/src/components/Construction.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React, { forwardRef } from 'react'
import { Box, BoxProps, Typography } from '@mui/material'
import { Icons } from '../assets/icons'
import { grey } from '@mui/material/colors'

interface ConstructionProps extends BoxProps {}

const Construction = forwardRef<typeof Box, ConstructionProps>(
({ ...props }, ref) => {
return (
<Box
ref={ref}
sx={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
flexDirection: 'column',
color: grey[500]
}}>
<Icons.Foundation fontSize="large" />
<Typography paragraph>Under constraction</Typography>
</Box>
)
}
)

Construction.displayName = 'Construction'
export default Construction
25 changes: 25 additions & 0 deletions eventmesh-dashboard-view/src/components/Page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React, { forwardRef } from 'react'
import { Box, BoxProps } from '@mui/material'

interface PageProps extends BoxProps {}

const Page = forwardRef<typeof Box, PageProps>(
({ children, ...props }, ref) => {
return (
<Box
ref={ref}
sx={{
width: 1,
height: 1,
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
}}>
{children}
</Box>
)
}
)

Page.displayName = 'Page'
export default Page
47 changes: 30 additions & 17 deletions eventmesh-dashboard-view/src/routes/Routes.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,39 @@
import React from "react";
import { useRoutes, Navigate } from "react-router-dom";
import RootLayout from "./RootLayout";
import Home from "./home/Home";
import Topic from "./topic/Topic";
import React from 'react'
import { useRoutes, Navigate } from 'react-router-dom'
import RootLayout from './RootLayout'
import Home from './home/Home'
import Topic from './topic/Topic'
import Runtime from './runtime/Runtime'
import Connection from './connection/Connection'
import Message from './message/Message'
import Security from './security/Security'
import Users from './users/Users'
import Logs from './logs/Logs'
import Settings from './settings/Settings'

const AppRoutes = () => {
return useRoutes([
{
path: "/",
path: '/',
element: <RootLayout />,
children: [
{
path: "*",
element: <Navigate to="/home" replace />,
path: '*',
element: <Navigate to="/home" replace />
},
{ path: "", element: <Navigate to="/home" /> },
{ path: "home", element: <Home /> },
{ path: "topic", element: <Topic /> },
],
},
]);
{ path: '', element: <Navigate to="/home" /> },
{ path: 'home', element: <Home /> },
{ path: 'runtime', element: <Runtime /> },
{ path: 'topic', element: <Topic /> },
{ path: 'connection', element: <Connection /> },
{ path: 'message', element: <Message /> },
{ path: 'security', element: <Security /> },
{ path: 'settings', element: <Settings /> },
{ path: 'users', element: <Users /> },
{ path: 'logs', element: <Logs /> }
]
}
])
}

};

export default AppRoutes;
export default AppRoutes
19 changes: 19 additions & 0 deletions eventmesh-dashboard-view/src/routes/connection/Connection.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React, { forwardRef } from 'react'
import { Box, BoxProps } from '@mui/material'
import Page from '../../components/Page'
import Construction from '../../components/Construction'

interface ConnectionProps extends BoxProps {}

const Connection = forwardRef<typeof Box, ConnectionProps>(
({ ...props }, ref) => {
return (
<Page>
<Construction />
</Page>
)
}
)

Connection.displayName = 'Connection'
export default Connection
18 changes: 12 additions & 6 deletions eventmesh-dashboard-view/src/routes/home/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import React, { forwardRef } from "react";
import { Box, BoxProps } from "@mui/material";
import React, { forwardRef } from 'react'
import { Box, BoxProps } from '@mui/material'
import Construction from '../../components/Construction'
import Page from '../../components/Page'

interface HomeProps extends BoxProps {}

const Home = forwardRef<typeof Box, HomeProps>(({ ...props }, ref) => {
return <Box ref={ref}>Home</Box>;
});
return (
<Page>
<Construction />
</Page>
)
})

Home.displayName = "Home";
export default Home;
Home.displayName = 'Home'
export default Home
17 changes: 17 additions & 0 deletions eventmesh-dashboard-view/src/routes/message/Message.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React, { forwardRef } from 'react'
import { Box, BoxProps } from '@mui/material'
import Page from '../../components/Page'
import Construction from '../../components/Construction'

interface MessageProps extends BoxProps {}

const Message = forwardRef<typeof Box, MessageProps>(({ ...props }, ref) => {
return (
<Page ref={ref}>
<Construction />
</Page>
)
})

Message.displayName = 'Message'
export default Message
17 changes: 17 additions & 0 deletions eventmesh-dashboard-view/src/routes/runtime/Runtime.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React, { forwardRef } from 'react'
import { Box, BoxProps } from '@mui/material'
import Page from '../../components/Page'
import Construction from '../../components/Construction'

interface RuntimeProps extends BoxProps {}

const Runtime = forwardRef<typeof Box, RuntimeProps>(({ ...props }, ref) => {
return (
<Page>
<Construction />
</Page>
)
})

Runtime.displayName = 'Runtime'
export default Runtime
17 changes: 17 additions & 0 deletions eventmesh-dashboard-view/src/routes/security/Security.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React, { forwardRef } from 'react'
import { Box, BoxProps } from '@mui/material'
import Page from '../../components/Page'
import Construction from '../../components/Construction'

interface SecurityProps extends BoxProps {}

const Security = forwardRef<typeof Box, SecurityProps>(({ ...props }, ref) => {
return (
<Page ref={ref}>
<Construction />
</Page>
)
})

Security.displayName = 'Security'
export default Security
17 changes: 17 additions & 0 deletions eventmesh-dashboard-view/src/routes/settings/Settings.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React, { forwardRef } from 'react'
import { Box, BoxProps } from '@mui/material'
import Page from '../../components/Page'
import Construction from '../../components/Construction'

interface SettingsProps extends BoxProps {}

const Settings = forwardRef<typeof Box, SettingsProps>(({ ...props }, ref) => {
return (
<Page ref={ref}>
<Construction />
</Page>
)
})

Settings.displayName = 'Settings'
export default Settings
17 changes: 17 additions & 0 deletions eventmesh-dashboard-view/src/routes/users/Users.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React, { forwardRef } from 'react'
import { Box, BoxProps } from '@mui/material'
import Page from '../../components/Page'
import Construction from '../../components/Construction'

interface UsersProps extends BoxProps {}

const Users = forwardRef<typeof Box, UsersProps>(({ ...props }, ref) => {
return (
<Page ref={ref}>
<Construction />
</Page>
)
})

Users.displayName = 'Users'
export default Users

0 comments on commit 6de0add

Please sign in to comment.