|
@@ -17,8 +17,8 @@ import {
|
|
|
updateMcpConfig,
|
|
updateMcpConfig,
|
|
|
getClientPrimitives,
|
|
getClientPrimitives,
|
|
|
restartAllClients,
|
|
restartAllClients,
|
|
|
- reinitializeMcpClients,
|
|
|
|
|
getClientErrors,
|
|
getClientErrors,
|
|
|
|
|
+ refreshClientStatus,
|
|
|
} from "../mcp/actions";
|
|
} from "../mcp/actions";
|
|
|
import { McpConfig, PresetServer, ServerConfig } from "../mcp/types";
|
|
import { McpConfig, PresetServer, ServerConfig } from "../mcp/types";
|
|
|
import clsx from "clsx";
|
|
import clsx from "clsx";
|
|
@@ -45,7 +45,7 @@ export function McpMarketPage() {
|
|
|
|
|
|
|
|
// 更新服务器状态
|
|
// 更新服务器状态
|
|
|
const updateServerStatus = async () => {
|
|
const updateServerStatus = async () => {
|
|
|
- await reinitializeMcpClients();
|
|
|
|
|
|
|
+ await refreshClientStatus();
|
|
|
const errors = await getClientErrors();
|
|
const errors = await getClientErrors();
|
|
|
setClientErrors(errors);
|
|
setClientErrors(errors);
|
|
|
};
|
|
};
|
|
@@ -74,6 +74,8 @@ export function McpMarketPage() {
|
|
|
setIsLoading(true);
|
|
setIsLoading(true);
|
|
|
await updateMcpConfig(newConfig);
|
|
await updateMcpConfig(newConfig);
|
|
|
setConfig(newConfig);
|
|
setConfig(newConfig);
|
|
|
|
|
+ // 配置改变时需要重新初始化
|
|
|
|
|
+ await restartAllClients();
|
|
|
await updateServerStatus();
|
|
await updateServerStatus();
|
|
|
showToast("Configuration saved successfully");
|
|
showToast("Configuration saved successfully");
|
|
|
} catch (error) {
|
|
} catch (error) {
|