This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new 871d1b2bb feat(config-ui): add new page not found (#6811)
871d1b2bb is described below
commit 871d1b2bb801d6ba22248f4b72da050b569e4db2
Author: 青湛 <[email protected]>
AuthorDate: Mon Jan 15 20:20:36 2024 +1300
feat(config-ui): add new page not found (#6811)
---
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>
+ );
+};