From 5ac413ff69ee79d4e6d9f8527d5e2e16915b1755 Mon Sep 17 00:00:00 2001 From: jZonG Date: Thu, 29 May 2025 16:40:25 +0800 Subject: [PATCH 1/2] fix: timestamp & updating loader --- web/app/components/tools/mcp/detail/content.tsx | 6 +++--- web/app/components/tools/mcp/provider-card.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/app/components/tools/mcp/detail/content.tsx b/web/app/components/tools/mcp/detail/content.tsx index cb2263809c..6ffbe15184 100644 --- a/web/app/components/tools/mcp/detail/content.tsx +++ b/web/app/components/tools/mcp/detail/content.tsx @@ -194,7 +194,7 @@ const MCPDetailContent: FC = ({ )} - {detail.is_team_authorization && !isGettingTools && !toolList.length && ( + {!isUpdating && detail.is_team_authorization && !isGettingTools && !toolList.length && (
{t('tools.mcp.toolsEmpty')}
)} - {!isGettingTools && toolList.length > 0 && ( + {!isUpdating && !isGettingTools && toolList.length > 0 && ( <>
@@ -228,7 +228,7 @@ const MCPDetailContent: FC = ({ )} - {!detail.is_team_authorization && ( + {!isUpdating && !detail.is_team_authorization && (
{!isAuthorizing &&
{t('tools.mcp.authorizingRequired')}
} {isAuthorizing &&
{t('tools.mcp.authorizing')}
} diff --git a/web/app/components/tools/mcp/provider-card.tsx b/web/app/components/tools/mcp/provider-card.tsx index a28b0a1ca7..9ff579ef96 100644 --- a/web/app/components/tools/mcp/provider-card.tsx +++ b/web/app/components/tools/mcp/provider-card.tsx @@ -101,7 +101,7 @@ const MCPCard = ({ )}
/
-
{`${t('tools.mcp.updateTime')} ${formatTimeFromNow(data.updated_at!)}`}
+
{`${t('tools.mcp.updateTime')} ${formatTimeFromNow(data.updated_at! * 1000)}`}
From d2a4e3eedc14964b041a124e73b1c01e8df602d6 Mon Sep 17 00:00:00 2001 From: jZonG Date: Thu, 29 May 2025 16:45:30 +0800 Subject: [PATCH 2/2] modify api --- web/app/components/tools/mcp/detail/content.tsx | 1 - web/app/components/tools/mcp/index.tsx | 2 -- web/service/use-tools.ts | 4 ++-- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/web/app/components/tools/mcp/detail/content.tsx b/web/app/components/tools/mcp/detail/content.tsx index 6ffbe15184..c3df795836 100644 --- a/web/app/components/tools/mcp/detail/content.tsx +++ b/web/app/components/tools/mcp/detail/content.tsx @@ -86,7 +86,6 @@ const MCPDetailContent: FC = ({ return const res = await authorizeMcp({ provider_id: detail.id, - server_url: detail.server_url!, }) if (res.result === 'success') handleUpdateTools() diff --git a/web/app/components/tools/mcp/index.tsx b/web/app/components/tools/mcp/index.tsx index e4ca24120a..c5d06d571b 100644 --- a/web/app/components/tools/mcp/index.tsx +++ b/web/app/components/tools/mcp/index.tsx @@ -70,7 +70,6 @@ const MCPList = ({ setCurrentProviderID(provider.id) await authorizeMcp({ provider_id: provider.id, - server_url: provider.server_url!, }) await refetch() // update authorization in list await updateTools(provider.id) @@ -84,7 +83,6 @@ const MCPList = ({ if (!targetProvider) return await updateMCPAuthorizationToken({ provider_id: providerID, - server_url: targetProvider.server_url!, authorization_code: code, }) await refetch() diff --git a/web/service/use-tools.ts b/web/service/use-tools.ts index 6c50112fa0..64a3ce7a1f 100644 --- a/web/service/use-tools.ts +++ b/web/service/use-tools.ts @@ -140,7 +140,7 @@ export const useDeleteMCP = ({ export const useAuthorizeMCP = () => { return useMutation({ mutationKey: [NAME_SPACE, 'authorize-mcp'], - mutationFn: (payload: { provider_id: string; server_url: string }) => { + mutationFn: (payload: { provider_id: string; }) => { return post<{ result?: string; authorization_url?: string }>('/workspaces/current/tool-provider/mcp/auth', { body: payload, }) @@ -151,7 +151,7 @@ export const useAuthorizeMCP = () => { export const useUpdateMCPAuthorizationToken = () => { return useMutation({ mutationKey: [NAME_SPACE, 'refresh-mcp-server-code'], - mutationFn: (payload: { provider_id: string; server_url: string; authorization_code: string }) => { + mutationFn: (payload: { provider_id: string; authorization_code: string }) => { return get('/workspaces/current/tool-provider/mcp/token', { params: { ...payload,