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 } ];