From 3bd2bee321a3fd4398dcfeaaaeaac202d60131ac Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Tue, 15 Jul 2025 16:05:48 +0800 Subject: [PATCH] feat(ui): custom 404 page --- ui/src/pages/ErrorLayout.tsx | 12 ++++++++++++ ui/src/router.tsx | 14 ++++++++++++++ .../declarations.d.ts => types/shims-antd.d.ts} | 0 3 files changed, 26 insertions(+) create mode 100644 ui/src/pages/ErrorLayout.tsx rename ui/{src/declarations.d.ts => types/shims-antd.d.ts} (100%) diff --git a/ui/src/pages/ErrorLayout.tsx b/ui/src/pages/ErrorLayout.tsx new file mode 100644 index 00000000..94a6ba63 --- /dev/null +++ b/ui/src/pages/ErrorLayout.tsx @@ -0,0 +1,12 @@ +import { Outlet } from "react-router-dom"; +import { Layout } from "antd"; + +const ErrorLayout = ({ children }: { children?: React.ReactNode }) => { + return ( + +
{children || }
+
+ ); +}; + +export default ErrorLayout; diff --git a/ui/src/router.tsx b/ui/src/router.tsx index 923f7f6f..a386c221 100644 --- a/ui/src/router.tsx +++ b/ui/src/router.tsx @@ -5,6 +5,7 @@ import AuthLayout from "./pages/AuthLayout"; import CertificateList from "./pages/certificates/CertificateList"; import ConsoleLayout from "./pages/ConsoleLayout"; import Dashboard from "./pages/dashboard/Dashboard"; +import ErrorLayout from "./pages/ErrorLayout"; import Login from "./pages/login/Login"; import Settings from "./pages/settings/Settings"; import SettingsAccount from "./pages/settings/SettingsAccount"; @@ -83,4 +84,17 @@ export const router = createHashRouter([ }, ], }, + { + path: "*", + element: ( + +
+
+

404

+

This page could not be found.

+
+
+
+ ), + }, ]); diff --git a/ui/src/declarations.d.ts b/ui/types/shims-antd.d.ts similarity index 100% rename from ui/src/declarations.d.ts rename to ui/types/shims-antd.d.ts