From 9ed87161a5cf7fd89e470e89841f1f335b971cd1 Mon Sep 17 00:00:00 2001 From: ZhaiSoul <842607283@qq.com> Date: Tue, 16 Sep 2025 13:01:53 +0800 Subject: [PATCH] feat: add login pages forgot password tips --- web/public/locales/en/components/auth.json | 4 +++ web/src/components/auth/AuthForm.tsx | 34 ++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/web/public/locales/en/components/auth.json b/web/public/locales/en/components/auth.json index 05c2a779f..1fbb29e97 100644 --- a/web/public/locales/en/components/auth.json +++ b/web/public/locales/en/components/auth.json @@ -3,6 +3,10 @@ "user": "Username", "password": "Password", "login": "Login", + "forgotPassword": { + "label": "Forgot password?", + "tips": "If you forgot your password, please refer to the following documentation to modify the configuration file and reset your password." + }, "errors": { "usernameRequired": "Username is required", "passwordRequired": "Password is required", diff --git a/web/src/components/auth/AuthForm.tsx b/web/src/components/auth/AuthForm.tsx index 12e8f777e..8722fd847 100644 --- a/web/src/components/auth/AuthForm.tsx +++ b/web/src/components/auth/AuthForm.tsx @@ -17,16 +17,24 @@ import { FormItem, FormLabel, } from "@/components/ui/form"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "@/components/ui/popover"; import { useForm } from "react-hook-form"; import { zodResolver } from "@hookform/resolvers/zod"; import { z } from "zod"; import { AuthContext } from "@/context/auth-context"; import { useTranslation } from "react-i18next"; +import { useDocDomain } from "@/hooks/use-doc-domain"; +import { LuExternalLink } from "react-icons/lu"; interface UserAuthFormProps extends React.HTMLAttributes {} export function UserAuthForm({ className, ...props }: UserAuthFormProps) { const { t } = useTranslation(["components/auth"]); + const { getLocaleDocUrl } = useDocDomain(); const [isLoading, setIsLoading] = React.useState(false); const { login } = React.useContext(AuthContext); @@ -120,6 +128,32 @@ export function UserAuthForm({ className, ...props }: UserAuthFormProps) { {...field} /> + + + +
+ + {t("form.forgotPassword.label")} + +
+
+ + {t("form.forgotPassword.tips")} +
+ + {t("readTheDocumentation", { ns: "common" })} + + +
+
+
)} />