This is an automated email from the ASF dual-hosted git repository. mintsweet pushed a commit to branch feat-not-found in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit ca21572cd1de55231ee472e26b3562ddb3e0ef78 Author: mintsweet <[email protected]> AuthorDate: Mon Jan 15 20:17:07 2024 +1300 feat(config-ui): add new page not found --- config-ui/src/app/routrer.tsx | 5 +++ config-ui/src/routes/index.ts | 1 + .../src/routes/{index.ts => not-found/index.tsx} | 36 +++++++++++++++++----- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/config-ui/src/app/routrer.tsx b/config-ui/src/app/routrer.tsx index e67c938fc..e8d6ce94c 100644 --- a/config-ui/src/app/routrer.tsx +++ b/config-ui/src/app/routrer.tsx @@ -33,6 +33,7 @@ import { Pipelines, Pipeline, ApiKeys, + NotFound, } from '@/routes'; const PATH_PREFIX = import.meta.env.DEVLAKE_PATH_PREFIX ?? ''; @@ -107,4 +108,8 @@ export const router = createBrowserRouter([ }, ], }, + { + path: '*', + element: <NotFound />, + }, ]); diff --git a/config-ui/src/routes/index.ts b/config-ui/src/routes/index.ts index 749fd137b..b640be499 100644 --- a/config-ui/src/routes/index.ts +++ b/config-ui/src/routes/index.ts @@ -22,5 +22,6 @@ export * from './connection'; export * from './db-migrate'; export * from './error'; export * from './layout'; +export * from './not-found'; export * from './pipeline'; export * from './project'; diff --git a/config-ui/src/routes/index.ts b/config-ui/src/routes/not-found/index.tsx similarity index 52% copy from config-ui/src/routes/index.ts copy to config-ui/src/routes/not-found/index.tsx index 749fd137b..e9645c3a9 100644 --- a/config-ui/src/routes/index.ts +++ b/config-ui/src/routes/not-found/index.tsx @@ -16,11 +16,31 @@ * */ -export * from './api-keys'; -export * from './blueprint'; -export * from './connection'; -export * from './db-migrate'; -export * from './error'; -export * from './layout'; -export * from './pipeline'; -export * from './project'; +import { useNavigate } from 'react-router-dom'; +import { ExclamationCircleOutlined } from '@ant-design/icons'; +import { Card, Space, Flex, Button } from 'antd'; + +import { TipLayout } from '@/components'; + +export const NotFound = () => { + const navigate = useNavigate(); + + return ( + <TipLayout> + <Card> + <h2> + <Space> + <ExclamationCircleOutlined style={{ fontSize: 20, color: '#faad14' }} /> + <span>404 Not Found</span> + </Space> + </h2> + <p>This is an invalid address.</p> + <Flex justify="center"> + <Button type="primary" onClick={() => navigate('/')}> + Go HomePage + </Button> + </Flex> + </Card> + </TipLayout> + ); +};
