From 3b72f4e6f59895541a6d3f106e590e166d41c7a5 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Fri, 8 May 2026 18:46:11 +0800 Subject: [PATCH] remove copy for api button --- .../detail/access-tab/api-keys.tsx | 36 ------------------- 1 file changed, 36 deletions(-) diff --git a/web/features/deployments/detail/access-tab/api-keys.tsx b/web/features/deployments/detail/access-tab/api-keys.tsx index 5f55227a6d..e2a471ae7b 100644 --- a/web/features/deployments/detail/access-tab/api-keys.tsx +++ b/web/features/deployments/detail/access-tab/api-keys.tsx @@ -8,7 +8,6 @@ import { DropdownMenuItem, DropdownMenuTrigger, } from '@langgenius/dify-ui/dropdown-menu' -import { toast } from '@langgenius/dify-ui/toast' import { useMutation } from '@tanstack/react-query' import { useSetAtom } from 'jotai' import { useState } from 'react' @@ -16,16 +15,13 @@ import { useTranslation } from 'react-i18next' import { consoleQuery } from '@/service/client' import { createdDeveloperApiTokenAtom } from '../../store' import { environmentName } from '../../utils' -import { useCopyFeedback } from './use-copy-feedback' function ApiKeyRow({ appInstanceId, apiKey }: { appInstanceId: string apiKey: DeveloperApiKeyRow }) { const { t } = useTranslation('deployments') - const { copied, showCopied } = useCopyFeedback() const revokeApiKey = useMutation(consoleQuery.enterprise.appDeploy.deleteDeveloperApiKey.mutationOptions()) - const revealApiKey = useMutation(consoleQuery.enterprise.appDeploy.revealDeveloperApiKey.mutationOptions()) const displayValue = apiKey.maskedKey || apiKey.id || '—' const environmentLabel = environmentName(apiKey.environment) @@ -41,30 +37,6 @@ function ApiKeyRow({ appInstanceId, apiKey }: { }) } - const handleCopy = async () => { - if (!apiKey.id) - return - - try { - const response = await revealApiKey.mutateAsync({ - params: { - appInstanceId, - apiKeyId: apiKey.id, - }, - }) - if (!response.token) - throw new Error('Reveal developer API key did not return a token.') - - const token = response.token - await navigator.clipboard.writeText(token) - showCopied() - toast.success(t('access.copyToast')) - } - catch { - toast.error(t('access.copyFailed')) - } - } - return (