fix(mcp): properly save and display description field

- Initialize formDescription from initialData.description when editing
- Save formDescription to server object before submitting
- Display only description in list items, hide technical details
- Show empty space when description is not available
This commit is contained in:
Jason
2025-10-09 23:13:33 +08:00
parent 29b8d5edde
commit eb8d9352c8
3 changed files with 20 additions and 14 deletions

View File

@@ -251,9 +251,6 @@ const McpPanel: React.FC<McpPanelProps> = ({ onClose, onNotify }) => {
...(p.server as McpServer),
enabled: false,
} as McpServer;
const details = [s.type, s.command, ...(s.args || [])].join(
" · ",
);
return (
<div
key={`preset-${p.id}`}
@@ -273,9 +270,11 @@ const McpPanel: React.FC<McpPanelProps> = ({ onClose, onNotify }) => {
<h3 className="font-medium text-gray-900 dark:text-gray-100 mb-1">
{p.id}
</h3>
<p className="text-sm text-gray-500 dark:text-gray-400 truncate">
{details}
</p>
{p.description && (
<p className="text-sm text-gray-500 dark:text-gray-400 truncate">
{p.description}
</p>
)}
</div>
</div>
</div>