From d4e776102370c30517728c86c8229f52dfd03eb7 Mon Sep 17 00:00:00 2001 From: MyGit <3282299728@qq.com> Date: Tue, 9 Jul 2024 19:19:14 +0800 Subject: [PATCH 1/3] =?UTF-8?q?style:=E6=9A=97=E9=BB=91=E8=A1=A5=E5=85=A8?= =?UTF-8?q?=EF=BC=8Cswitch=E5=AF=BC=E8=87=B4=E6=BB=9A=E5=8A=A8=E6=9D=A1?= =?UTF-8?q?=E9=97=AA=E7=83=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bs-comp/chatComponent/ChatInput.tsx | 3 +- .../bs-comp/sheets/SkillTempSheet.tsx | 2 +- .../pages/SystemPage/components/EditRole.tsx | 42 +++++++++---------- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/frontend/src/components/bs-comp/chatComponent/ChatInput.tsx b/src/frontend/src/components/bs-comp/chatComponent/ChatInput.tsx index 63ae0405c..6d52cfafb 100644 --- a/src/frontend/src/components/bs-comp/chatComponent/ChatInput.tsx +++ b/src/frontend/src/components/bs-comp/chatComponent/ChatInput.tsx @@ -200,6 +200,7 @@ export default function ChatInput({ clear, form, stop, questions, inputForm, wsU if (data.type === 'start') { createWsMsg(data) } else if (data.type === 'stream') { + //@ts-ignore updateCurrentMessage({ chat_id: data.chat_id, message: data.message, @@ -256,7 +257,7 @@ export default function ChatInput({ clear, form, stop, questions, inputForm, wsU {/* form */} { formShow &&
-
+
{inputForm}
diff --git a/src/frontend/src/components/bs-comp/sheets/SkillTempSheet.tsx b/src/frontend/src/components/bs-comp/sheets/SkillTempSheet.tsx index 518e70afb..52e567690 100644 --- a/src/frontend/src/components/bs-comp/sheets/SkillTempSheet.tsx +++ b/src/frontend/src/components/bs-comp/sheets/SkillTempSheet.tsx @@ -37,7 +37,7 @@ export default function SkillTempSheet({ children, onSelect }) { {t('skills.skillTemplateChoose')} setKeyword(e.target.value)} />
-
+
setForm({ ...form, name: e.target.value })} maxLength={60}>
{/* 菜单授权 */} -
+

菜单授权

-
+
一级菜单 - 查看权限 + 查看权限 构建 - + switchDataChange(MenuType.BUILD, 'useMenu', bln)} /> 知识 - + switchDataChange(MenuType.KNOWLEDGE, 'useMenu', bln)} /> 模型 - + switchDataChange(MenuType.MODEL, 'useMenu', bln)} /> 评测 - + switchDataChange(MenuType.EVALUATION, 'useMenu', bln)} /> @@ -220,8 +220,8 @@ export default function EditRole({ id, name, groupId, onChange, onBeforeChange } {t('system.assistantName')} - {t('system.creator')} - {t('system.usePermission')} + {t('system.creator')} + {t('system.usePermission')} @@ -229,7 +229,7 @@ export default function EditRole({ id, name, groupId, onChange, onBeforeChange } {el.name} {el.user_name} - + switchDataChange(el.id, 'useAssistant', bln)} /> @@ -251,8 +251,8 @@ export default function EditRole({ id, name, groupId, onChange, onBeforeChange } {t('system.skillName')} - {t('system.creator')} - {t('system.usePermission')} + {t('system.creator')} + {t('system.usePermission')} @@ -260,7 +260,7 @@ export default function EditRole({ id, name, groupId, onChange, onBeforeChange } {el.name} {el.user_name} - + switchDataChange(el.id, 'useSkills', bln)} /> @@ -281,9 +281,9 @@ export default function EditRole({ id, name, groupId, onChange, onBeforeChange } {t('lib.libraryName')} - {t('system.creator')} - {t('system.usePermission')} - {t('system.managePermission')} + {t('system.creator')} + {t('system.usePermission')} + {t('system.managePermission')} @@ -291,10 +291,10 @@ export default function EditRole({ id, name, groupId, onChange, onBeforeChange } {el.name} {el.user_name} - + switchUseLib(el.id, bln)} /> - + switchLibManage(el.id, bln)} /> @@ -316,8 +316,8 @@ export default function EditRole({ id, name, groupId, onChange, onBeforeChange } {t('lib.toolName')} - {t('system.creator')} - {t('system.usePermission')} + {t('system.creator')} + {t('system.usePermission')} @@ -325,7 +325,7 @@ export default function EditRole({ id, name, groupId, onChange, onBeforeChange } {el.name} {el.user_name} - + switchDataChange(el.id, 'useTools', bln)} From ead1233f36b1cd332ba2296b2c8e264dcab459cb Mon Sep 17 00:00:00 2001 From: MyGit <3282299728@qq.com> Date: Wed, 10 Jul 2024 11:36:38 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9E=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E6=A1=86=E7=BB=84=E4=BB=B6=EF=BC=8C=E6=8E=A7=E5=88=B6=E6=98=BE?= =?UTF-8?q?=E9=9A=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/bs-ui/input/index.tsx | 24 +++++++++++++++++- .../src/pages/LoginPage/UserPwdModal.tsx | 5 ++-- src/frontend/src/pages/LoginPage/resetPwd.tsx | 17 ++++++------- .../SystemPage/components/CreateUser.tsx | 25 ++++--------------- 4 files changed, 37 insertions(+), 34 deletions(-) diff --git a/src/frontend/src/components/bs-ui/input/index.tsx b/src/frontend/src/components/bs-ui/input/index.tsx index 093fb91db..496ce97cc 100644 --- a/src/frontend/src/components/bs-ui/input/index.tsx +++ b/src/frontend/src/components/bs-ui/input/index.tsx @@ -3,6 +3,9 @@ import { cname } from "../utils" import { SearchIcon } from "../../bs-icons/search" import { generateUUID } from "../utils" import { MinusCircledIcon } from "@radix-ui/react-icons" +import { EyeOpenIcon, EyeNoneIcon } from "@radix-ui/react-icons" +import { useState } from "react" + export interface InputProps extends React.InputHTMLAttributes { } @@ -36,6 +39,25 @@ const SearchInput = React.forwardRef( + ({ className, inputClassName, iconClassName, ...props }, ref) => { + const [type, setType] = useState('password') + const handleShowPwd = () => { + type === 'password' ? setType('text') : setType('password') + } + return
+ + { + type === 'password' + ? + : + } +
+ } +) + +PasswordInput.displayName = 'PasswordInput' + /** * 多行文本 @@ -144,4 +166,4 @@ const InputList = React.forwardRef((props, ref)
- passwordRef.current.value = e.target.value} diff --git a/src/frontend/src/pages/LoginPage/resetPwd.tsx b/src/frontend/src/pages/LoginPage/resetPwd.tsx index ce9c90f88..ed9bc08ad 100644 --- a/src/frontend/src/pages/LoginPage/resetPwd.tsx +++ b/src/frontend/src/pages/LoginPage/resetPwd.tsx @@ -4,7 +4,7 @@ import { useEffect, useRef } from "react"; import { useTranslation } from 'react-i18next'; import { useLocation, useNavigate } from 'react-router-dom'; import { Button } from "../../components/bs-ui/button"; -import { Input } from "../../components/bs-ui/input"; +import { PasswordInput } from "../../components/bs-ui/input"; import { loggedChangePasswordApi, changePasswordApi } from "../../controllers/API/user"; import { captureAndAlertRequestErrorHoc } from "../../controllers/request"; import { PWD_RULE, handleEncrypt } from './utils'; @@ -89,30 +89,27 @@ export const ResetPwdPage = () => {
-
-
-