diff --git a/src/frontend/public/locales/en/bs.json b/src/frontend/public/locales/en/bs.json index b2516f57b..37932d7ec 100644 --- a/src/frontend/public/locales/en/bs.json +++ b/src/frontend/public/locales/en/bs.json @@ -37,6 +37,7 @@ "document": "Documentation", "logout": "Logout", "logoutDescription": "Log out", + "logoutContent": "Are you sure to log out", "forBestExperience": "For the best experience, please access this website on a PC", "onlineDocumentation": "Online Documentation", "changePwd": "Password" diff --git a/src/frontend/public/locales/zh/bs.json b/src/frontend/public/locales/zh/bs.json index 8b52f76dc..a037ebc21 100644 --- a/src/frontend/public/locales/zh/bs.json +++ b/src/frontend/public/locales/zh/bs.json @@ -38,6 +38,7 @@ "document": "文档", "logout": "退出", "logoutDescription": "退出登录", + "logoutContent": "确认退出登录吗", "forBestExperience": "为了您的良好体验,请在 PC 端访问该网站", "onlineDocumentation": "在线文档", "changePwd": "修改密码" diff --git a/src/frontend/src/layout/MainLayout.tsx b/src/frontend/src/layout/MainLayout.tsx index 99723ec4f..0ff0a5799 100755 --- a/src/frontend/src/layout/MainLayout.tsx +++ b/src/frontend/src/layout/MainLayout.tsx @@ -40,7 +40,7 @@ export default function MainLayout() { const handleLogout = () => { bsConfirm({ title: `${t('prompt')}!`, - desc: `${t('menu.logoutDescription')}?`, + desc: `${t('menu.logoutContent')}?`, okTxt: t('system.confirm'), onOk(next) { captureAndAlertRequestErrorHoc(logoutApi()).then(_ => { diff --git a/src/frontend/src/pages/LogPage/index.tsx b/src/frontend/src/pages/LogPage/index.tsx index 9227a42b3..5e365fdaf 100644 --- a/src/frontend/src/pages/LogPage/index.tsx +++ b/src/frontend/src/pages/LogPage/index.tsx @@ -146,7 +146,7 @@ export default function index() { {t('log.objectType')} {t('log.operationObject')} {t('log.ipAddress')} - {t('log.remark')} + {t('log.remark')} @@ -158,10 +158,10 @@ export default function index() { {transformModule(log.system_id)} {transformEvent(log.event_type)} {transformObjectType(log.object_type)} - {log.object_name} + {log.object_name || '无'} {log.ip_address} - {log.note?.replace('编辑后', `\n编辑后`)} + {log.note?.replace('编辑后', `\n编辑后`) || '无'} ))} diff --git a/src/frontend/src/pages/SystemPage/components/CreateUser.tsx b/src/frontend/src/pages/SystemPage/components/CreateUser.tsx index fa0cd61d0..bd8c5921c 100644 --- a/src/frontend/src/pages/SystemPage/components/CreateUser.tsx +++ b/src/frontend/src/pages/SystemPage/components/CreateUser.tsx @@ -1,17 +1,23 @@ -import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "@/components/bs-ui/dialog" import { Button } from "@/components/bs-ui/button" -import { useTranslation } from "react-i18next" -import { Label } from "@/components/bs-ui/label" +import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "@/components/bs-ui/dialog" import { Input } from "@/components/bs-ui/input" -import UserRoleItem from "./UserRoleItem" -import { PlusIcon } from "@radix-ui/react-icons" -import { useState } from "react" -import { generateUUID } from "@/components/bs-ui/utils" +import { Label } from "@/components/bs-ui/label" import { useToast } from "@/components/bs-ui/toast/use-toast" -import { handleEncrypt, PWD_RULE } from "@/pages/LoginPage/utils" -import { copyText } from "@/utils" +import { generateUUID } from "@/components/bs-ui/utils" import { createUserApi } from "@/controllers/API/user" import { captureAndAlertRequestErrorHoc } from "@/controllers/request" +import { handleEncrypt, PWD_RULE } from "@/pages/LoginPage/utils" +import { copyText } from "@/utils" +import { EyeNoneIcon, EyeOpenIcon, PlusIcon } from "@radix-ui/react-icons" +import { useState } from "react" +import { useTranslation } from "react-i18next" +import UserRoleItem from "./UserRoleItem" + +enum inputType { + PASSWORD = 'password', + TEXT = 'text' +} +const EyeIconStyle = 'absolute right-7 cursor-pointer' export default function CreateUser({open, onClose, onSave}) { const { t } = useTranslation() @@ -59,6 +65,11 @@ export default function CreateUser({open, onClose, onSave}) { })) } + const [type, setType] = useState(inputType.PASSWORD) + const handleShowPwd = () => { + type === inputType.PASSWORD ? setType(inputType.TEXT) : setType(inputType.PASSWORD) + } + return onClose(b)}> @@ -68,16 +79,20 @@ export default function CreateUser({open, onClose, onSave}) { {t('log.username')} setForm({...form, user_name:e.target.value})} - placeholder="后续使用此用户名进行登录,用户名不可修改"/> + placeholder="后续使用此用户名进行登录,用户名不可修改" className="h-[50px]"/> 初始密码 - setForm({...form, password:e.target.value})}/> + + setForm({...form, password:e.target.value})} className="h-[50px]"/> + {type === inputType.PASSWORD ? + : } + 用户组/角色选择 - + {items.map((item, index) => 1}