refactor(constants): rename default model icon to include size and color info

main
sp mac bookpro 2605 2026-05-25 23:36:21 +08:00
parent 2a925ff514
commit 0fd6274854
2 changed files with 6 additions and 6 deletions

View File

@ -1 +1 @@
export const DEFAULT_MODEL_ICON = 'https://placehold.co/40x40/f3f4f6/9ca3af?text=RH'; export const PLACEHOLDER_40X40_GRAY = 'https://placehold.co/40x40/f3f4f6/9ca3af?text=RH';

View File

@ -3,7 +3,7 @@ import { Button, Form, Input, InputNumber, Modal, Upload, App as AntApp, List, P
import type { UploadFile } from 'antd/es/upload/interface'; import type { UploadFile } from 'antd/es/upload/interface';
import { useNavigate, useParams } from 'react-router-dom'; import { useNavigate, useParams } from 'react-router-dom';
import { Agent, AgentAPI, ImageAPI, KnowledgeStatus, SkillType, Team, TeamAPI, AiModel, ModelAPI } from '../api'; import { Agent, AgentAPI, ImageAPI, KnowledgeStatus, SkillType, Team, TeamAPI, AiModel, ModelAPI } from '../api';
import { DEFAULT_MODEL_ICON } from '../constants'; import { PLACEHOLDER_40X40_GRAY } from '../constants';
import SkillEditor from '../components/SkillEditor'; import SkillEditor from '../components/SkillEditor';
import McpPanel from '../components/McpPanel'; import McpPanel from '../components/McpPanel';
import ChatPreview from '../components/ChatPreview'; import ChatPreview from '../components/ChatPreview';
@ -491,10 +491,10 @@ export default function AgentEditor() {
value: m.model_name, value: m.model_name,
label: ( label: (
<div className="flex items-center justify-between w-full py-1"> <div className="flex items-center justify-between w-full py-1">
<div className="flex items-center gap-2" style={{ flex: 1, minWidth: 0 }}> <div className="flex items-center gap-2" style={{ flex: 1, minWidth: 0 }}>
<img src={m.icon || DEFAULT_MODEL_ICON} alt={m.model_name} style={{ width: 20, height: 20, objectFit: 'contain', borderRadius: 4, flexShrink: 0 }} /> <img src={m.icon || PLACEHOLDER_40X40_GRAY} alt={m.model_name} style={{ width: 20, height: 20, objectFit: 'contain', borderRadius: 4, flexShrink: 0 }} />
<span className="font-medium text-gray-800" style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{m.model_name}</span> <span className="font-medium text-gray-800" style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{m.model_name}</span>
</div> </div>
<div className="flex flex-col items-end justify-center text-[10px] text-gray-400" style={{ flexShrink: 0, marginLeft: 8 }}> <div className="flex flex-col items-end justify-center text-[10px] text-gray-400" style={{ flexShrink: 0, marginLeft: 8 }}>
<span>: ${inputPrice.toFixed(2)}/M</span> <span>: ${inputPrice.toFixed(2)}/M</span>
<span>: ${outputPrice.toFixed(2)}/M</span> <span>: ${outputPrice.toFixed(2)}/M</span>