diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/oauth-client.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/oauth-client.tsx index a303cdd2c7..375c6001b4 100644 --- a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/oauth-client.tsx +++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/oauth-client.tsx @@ -114,13 +114,13 @@ export const OAuthClientSettingsModal = ({ oauthConfig, onClose, showOAuthCreate onClose() Toast.notify({ type: 'success', - message: t('pluginTrigger.modal.oauth.configuration.success'), + message: t('pluginTrigger.modal.oauth.remove.success'), }) }, onError: (error: any) => { Toast.notify({ type: 'error', - message: error?.message || t('pluginTrigger.modal.oauth.configuration.failed'), + message: error?.message || t('pluginTrigger.modal.oauth.remove.failed'), }) }, }) @@ -149,16 +149,16 @@ export const OAuthClientSettingsModal = ({ oauthConfig, onClose, showOAuthCreate configureOAuth(params, { onSuccess: () => { - if (needAuth) + if (needAuth) { handleAuthorization() - else + } + else { onClose() - }, - onError: (error: any) => { - Toast.notify({ - type: 'error', - message: error?.message || t('pluginTrigger.modal.oauth.configuration.failed'), - }) + Toast.notify({ + type: 'success', + message: t('pluginTrigger.modal.oauth.save.success'), + }) + } }, }) } diff --git a/web/i18n/en-US/plugin-trigger.ts b/web/i18n/en-US/plugin-trigger.ts index 3a5902a2c7..5fee874104 100644 --- a/web/i18n/en-US/plugin-trigger.ts +++ b/web/i18n/en-US/plugin-trigger.ts @@ -57,11 +57,11 @@ const translation = { description: 'Choose how you want to create your trigger subscription', options: { apikey: { - title: 'Via API Key', + title: 'Create with API Key', description: 'Automatically create subscription using API credentials', }, oauth: { - title: 'Via OAuth', + title: 'Create with OAuth', description: 'Authorize with third-party platform to create subscription', clientSettings: 'OAuth Client Settings', clientTitle: 'OAuth Client', @@ -94,7 +94,7 @@ const translation = { }, oauthRedirectInfo: 'As no system client secrets found for this tool provider, setup it manually is required, for redirect_uri, please use', apiKey: { - title: 'Create via API Key', + title: 'Create with API Key', verify: { title: 'Verify Credentials', description: 'Please provide your API credentials to verify access', @@ -107,7 +107,7 @@ const translation = { }, }, oauth: { - title: 'Create via OAuth', + title: 'Create with OAuth', authorization: { title: 'OAuth Authorization', description: 'Authorize Dify to access your account', @@ -123,6 +123,14 @@ const translation = { title: 'Configure Subscription', description: 'Set up your subscription parameters after authorization', success: 'OAuth configuration successful', + failed: 'OAuth configuration failed', + }, + remove: { + success: 'OAuth remove successful', + failed: 'OAuth remove failed', + }, + save: { + success: 'OAuth configuration saved successfully', }, }, manual: { diff --git a/web/i18n/zh-Hans/plugin-trigger.ts b/web/i18n/zh-Hans/plugin-trigger.ts index c4e6940bd2..5529edfe53 100644 --- a/web/i18n/zh-Hans/plugin-trigger.ts +++ b/web/i18n/zh-Hans/plugin-trigger.ts @@ -57,11 +57,11 @@ const translation = { description: '选择创建触发器订阅的方式', options: { apikey: { - title: '通过 API Key', + title: '通过 API Key 创建', description: '使用 API 凭据自动创建订阅', }, oauth: { - title: '通过 OAuth', + title: '通过 OAuth 创建', description: '与第三方平台授权以创建订阅', clientSettings: 'OAuth 客户端设置', clientTitle: 'OAuth 客户端', @@ -94,7 +94,7 @@ const translation = { }, oauthRedirectInfo: '由于未找到此工具提供方的系统客户端密钥,需要手动设置,对于 redirect_uri,请使用', apiKey: { - title: '通过 API 密钥创建', + title: '通过 API Key 创建', verify: { title: '验证凭据', description: '请提供您的 API 凭据以验证访问权限', @@ -123,6 +123,14 @@ const translation = { title: '配置订阅', description: '授权完成后设置您的订阅参数', success: 'OAuth 配置成功', + failed: 'OAuth 配置失败', + }, + remove: { + success: 'OAuth 移除成功', + failed: 'OAuth 移除失败', + }, + save: { + success: 'OAuth 配置保存成功', }, }, manual: {