Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions ui/ModelModal/src/ModelModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -100,6 +103,7 @@ export const ModelModal: React.FC<ModelModalProps> = ({
const [addModelError, setAddModelError] = useState('');
const [success, setSuccess] = useState(false);
const [expandAdvanced, setExpandAdvanced] = useState(false);
const [showPassword, setShowPassword] = useState(false);

const handleReset = () => {
onClose();
Expand Down Expand Up @@ -633,10 +637,23 @@ export const ModelModal: React.FC<ModelModalProps> = ({
{...field}
fullWidth
size='small'
type='password'
type={showPassword ? 'text' : 'password'}
placeholder=''
error={!!errors.api_key}
helperText={errors.api_key?.message}
InputProps={{
endAdornment: (
<InputAdornment position="end">
<IconButton
aria-label="toggle password visibility"
onClick={() => setShowPassword(!showPassword)}
edge="end"
>
{showPassword ? <VisibilityOff /> : <Visibility />}
</IconButton>
</InputAdornment>
),
}}
onChange={(e) => {
field.onChange(e.target.value);
setModelUserList([]);
Expand Down Expand Up @@ -775,7 +792,7 @@ export const ModelModal: React.FC<ModelModalProps> = ({
MenuProps: {
PaperProps: {
sx: {
maxHeight: 300,
maxHeight: 450,
'& .MuiList-root': {
paddingTop: 0,
}
Expand Down
4 changes: 2 additions & 2 deletions ui/ModelModal/src/components/ModelTagFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ const ModelTagFilter: React.FC<ModelTagFilterProps> = ({
// 定义可用的标签类型
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 }
];
Expand Down