From 2facb160aa975b96ed53f1fa67f5e86c9f654b62 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Fri, 6 Dec 2024 19:44:29 +0800 Subject: [PATCH] feat(ui): new Login UI using antd --- ui/index.html | 2 +- ui/package-lock.json | 16 ++- ui/package.json | 1 + ui/public/logo.svg | 2 + ui/public/vite.svg | 28 ----- ui/src/components/certimate/Version.tsx | 29 +++-- ui/src/pages/DashboardLayout.tsx | 4 +- ui/src/pages/LoginLayout.tsx | 5 +- ui/src/pages/accesses/AccessList.tsx | 1 + ui/src/pages/certificates/CertificateList.tsx | 4 +- ui/src/pages/login/Login.tsx | 109 +++++++----------- ui/src/pages/workflows/WorkflowList.tsx | 4 +- ui/src/repository/pocketbase.ts | 2 +- 13 files changed, 86 insertions(+), 121 deletions(-) create mode 100644 ui/public/logo.svg delete mode 100644 ui/public/vite.svg diff --git a/ui/index.html b/ui/index.html index c1604c3c..4a71aab8 100644 --- a/ui/index.html +++ b/ui/index.html @@ -2,7 +2,7 @@ - + Certimate - Your Trusted SSL Automation Partner diff --git a/ui/package-lock.json b/ui/package-lock.json index 88ff0bf6..0045e7c8 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -30,6 +30,7 @@ "@radix-ui/react-tooltip": "^1.1.2", "@tanstack/react-table": "^8.20.5", "antd": "^5.22.2", + "antd-zod": "^6.0.0", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "cmdk": "^1.0.0", @@ -3819,6 +3820,18 @@ "react-dom": ">=16.9.0" } }, + "node_modules/antd-zod": { + "version": "6.0.0", + "resolved": "https://registry.npmmirror.com/antd-zod/-/antd-zod-6.0.0.tgz", + "integrity": "sha512-dv5XXR72UtWm1Sz2IhRV5Ho0t7FGZtQLUbEQMeryY6k3W/K9MrvT+e1mV9Ye9tBY+vUD5CksN9cgSAlqimVMXQ==", + "dependencies": { + "lodash.merge": "^4.6.2" + }, + "peerDependencies": { + "antd": "^5.20.5", + "zod": ">=3.0.0" + } + }, "node_modules/any-promise": { "version": "1.3.0", "resolved": "https://registry.npmmirror.com/any-promise/-/any-promise-1.3.0.tgz", @@ -5715,8 +5728,7 @@ "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmmirror.com/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, "node_modules/loose-envify": { "version": "1.4.0", diff --git a/ui/package.json b/ui/package.json index 69387634..eda46449 100644 --- a/ui/package.json +++ b/ui/package.json @@ -32,6 +32,7 @@ "@radix-ui/react-tooltip": "^1.1.2", "@tanstack/react-table": "^8.20.5", "antd": "^5.22.2", + "antd-zod": "^6.0.0", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "cmdk": "^1.0.0", diff --git a/ui/public/logo.svg b/ui/public/logo.svg new file mode 100644 index 00000000..793e1647 --- /dev/null +++ b/ui/public/logo.svg @@ -0,0 +1,2 @@ + diff --git a/ui/public/vite.svg b/ui/public/vite.svg deleted file mode 100644 index 2d1e68d6..00000000 --- a/ui/public/vite.svg +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ui/src/components/certimate/Version.tsx b/ui/src/components/certimate/Version.tsx index 9ac18efe..207a88ef 100644 --- a/ui/src/components/certimate/Version.tsx +++ b/ui/src/components/certimate/Version.tsx @@ -1,8 +1,7 @@ import { useTranslation } from "react-i18next"; -import { BookOpen } from "lucide-react"; +import { Divider, Space, Typography } from "antd"; +import { BookOpen as BookOpenIcon } from "lucide-react"; -import { cn } from "@/components/ui/utils"; -import { Separator } from "@/components/ui/separator"; import { version } from "@/domain/version"; type VersionProps = { @@ -13,18 +12,18 @@ const Version = ({ className }: VersionProps) => { const { t } = useTranslation(); return ( -
-
- - -
{t("common.menu.document")}
-
- - - {version} - -
-
+ + +
+ + {t("common.menu.document")} +
+
+ + + {version} + +
); }; diff --git a/ui/src/pages/DashboardLayout.tsx b/ui/src/pages/DashboardLayout.tsx index b052ac6b..be293ae9 100644 --- a/ui/src/pages/DashboardLayout.tsx +++ b/ui/src/pages/DashboardLayout.tsx @@ -47,7 +47,7 @@ export default function Dashboard() {
- + Certimate
@@ -97,7 +97,7 @@ export default function Dashboard() {