From 25e2ff2b4310a50db6a50bd56622ff840fd0b503 Mon Sep 17 00:00:00 2001 From: jiangwel Date: Tue, 9 Sep 2025 11:14:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=BB=84=E4=BB=B6):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E6=98=BE=E7=A4=BA=E5=88=87=E6=8D=A2=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=B9=B6=E8=B0=83=E6=95=B4=E6=A0=87=E7=AD=BE=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在ModelModal中添加密码显示/隐藏切换功能 - 调整ModelTagFilter中标签的显示顺序 - 增加用户列表下拉菜单的最大高度 --- ui/ModelModal/src/ModelModal.tsx | 21 +++++++++++++++++-- .../src/components/ModelTagFilter.tsx | 4 ++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/ui/ModelModal/src/ModelModal.tsx b/ui/ModelModal/src/ModelModal.tsx index 5e3fa43..fbd1c2f 100644 --- a/ui/ModelModal/src/ModelModal.tsx +++ b/ui/ModelModal/src/ModelModal.tsx @@ -12,7 +12,10 @@ import { Checkbox, FormControlLabel, ListSubheader, + InputAdornment, + IconButton, } from '@mui/material'; +import { Visibility, VisibilityOff } from '@mui/icons-material'; import { Icon, message, Modal, ThemeProvider } from '@c-x/ui'; import Card from './components/card'; import ModelTagsWithLabel from './components/ModelTagsWithLabel'; @@ -100,6 +103,7 @@ export const ModelModal: React.FC = ({ const [addModelError, setAddModelError] = useState(''); const [success, setSuccess] = useState(false); const [expandAdvanced, setExpandAdvanced] = useState(false); + const [showPassword, setShowPassword] = useState(false); const handleReset = () => { onClose(); @@ -633,10 +637,23 @@ export const ModelModal: React.FC = ({ {...field} fullWidth size='small' - type='password' + type={showPassword ? 'text' : 'password'} placeholder='' error={!!errors.api_key} helperText={errors.api_key?.message} + InputProps={{ + endAdornment: ( + + setShowPassword(!showPassword)} + edge="end" + > + {showPassword ? : } + + + ), + }} onChange={(e) => { field.onChange(e.target.value); setModelUserList([]); @@ -775,7 +792,7 @@ export const ModelModal: React.FC = ({ MenuProps: { PaperProps: { sx: { - maxHeight: 300, + maxHeight: 450, '& .MuiList-root': { paddingTop: 0, } diff --git a/ui/ModelModal/src/components/ModelTagFilter.tsx b/ui/ModelModal/src/components/ModelTagFilter.tsx index 8f92f18..559fb02 100644 --- a/ui/ModelModal/src/components/ModelTagFilter.tsx +++ b/ui/ModelModal/src/components/ModelTagFilter.tsx @@ -37,10 +37,10 @@ const ModelTagFilter: React.FC = ({ // 定义可用的标签类型 const availableTags = [ { key: 'all', label: '全部', color: 'default' as const }, + { key: 'code', label: '代码生成', color: 'warning' as const }, { key: 'reasoning', label: '深度思考', color: 'primary' as const }, - { key: 'vision', label: '视觉', color: 'secondary' as const }, { key: 'function_calling', label: '工具调用', color: 'success' as const }, - { key: 'code', label: '代码生成', color: 'warning' as const }, + { key: 'vision', label: '视觉', color: 'secondary' as const }, { key: 'embedding', label: '向量', color: 'error' as const }, { key: 'rerank', label: '重排', color: 'default' as const } ];