feat(mcp): add enabled count to panel info section
- Add enabledCount calculation using useMemo for performance - Display format: "X MCP server(s) configured · Y enabled" - Add i18n keys: mcp.enabledCount for zh and en - Real-time updates when toggling server enabled status
This commit is contained in:
@@ -166,6 +166,11 @@ const McpPanel: React.FC<McpPanelProps> = ({ onClose, onNotify, appType }) => {
|
|||||||
[servers],
|
[servers],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const enabledCount = useMemo(
|
||||||
|
() => serverEntries.filter(([_, server]) => server.enabled).length,
|
||||||
|
[serverEntries],
|
||||||
|
);
|
||||||
|
|
||||||
const panelTitle =
|
const panelTitle =
|
||||||
appType === "claude" ? t("mcp.claudeTitle") : t("mcp.codexTitle");
|
appType === "claude" ? t("mcp.claudeTitle") : t("mcp.codexTitle");
|
||||||
|
|
||||||
@@ -205,7 +210,7 @@ const McpPanel: React.FC<McpPanelProps> = ({ onClose, onNotify, appType }) => {
|
|||||||
{/* Info Section */}
|
{/* Info Section */}
|
||||||
<div className="flex-shrink-0 px-6 pt-4 pb-2">
|
<div className="flex-shrink-0 px-6 pt-4 pb-2">
|
||||||
<div className="text-sm text-gray-500 dark:text-gray-400">
|
<div className="text-sm text-gray-500 dark:text-gray-400">
|
||||||
{t("mcp.serverCount", { count: Object.keys(servers).length })}
|
{t("mcp.serverCount", { count: Object.keys(servers).length })} · {t("mcp.enabledCount", { count: enabledCount })}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -275,6 +275,7 @@
|
|||||||
"editCodexServer": "Edit Codex MCP",
|
"editCodexServer": "Edit Codex MCP",
|
||||||
"configPath": "Config Path",
|
"configPath": "Config Path",
|
||||||
"serverCount": "{{count}} MCP server(s) configured",
|
"serverCount": "{{count}} MCP server(s) configured",
|
||||||
|
"enabledCount": "{{count}} enabled",
|
||||||
"template": {
|
"template": {
|
||||||
"fetch": "Quick Template: mcp-fetch"
|
"fetch": "Quick Template: mcp-fetch"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -275,6 +275,7 @@
|
|||||||
"editCodexServer": "编辑 Codex MCP",
|
"editCodexServer": "编辑 Codex MCP",
|
||||||
"configPath": "配置路径",
|
"configPath": "配置路径",
|
||||||
"serverCount": "已配置 {{count}} 个 MCP 服务器",
|
"serverCount": "已配置 {{count}} 个 MCP 服务器",
|
||||||
|
"enabledCount": "已启用 {{count}} 个",
|
||||||
"template": {
|
"template": {
|
||||||
"fetch": "快速模板:mcp-fetch"
|
"fetch": "快速模板:mcp-fetch"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user