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:
@@ -29,10 +29,8 @@ const McpListItem: React.FC<McpListItemProps> = ({
|
||||
// 默认启用
|
||||
const enabled = server.enabled !== false;
|
||||
|
||||
// 构建详细信息文本
|
||||
const details = ([server.type, server.command, ...(server.args || [])]
|
||||
.filter(Boolean) as string[])
|
||||
.join(" · ");
|
||||
// 只显示 description,没有则留空
|
||||
const description = (server as any).description || "";
|
||||
|
||||
return (
|
||||
<div className={cn(cardStyles.interactive, "!p-4")}>
|
||||
@@ -50,9 +48,11 @@ const McpListItem: React.FC<McpListItemProps> = ({
|
||||
<h3 className="font-medium text-gray-900 dark:text-gray-100 mb-1">
|
||||
{id}
|
||||
</h3>
|
||||
<p className="text-sm text-gray-500 dark:text-gray-400 truncate">
|
||||
{details}
|
||||
</p>
|
||||
{description && (
|
||||
<p className="text-sm text-gray-500 dark:text-gray-400 truncate">
|
||||
{description}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* 右侧:操作按钮 */}
|
||||
|
||||
Reference in New Issue
Block a user