From 10657b6bd3f232b48ec59d1208c8262b8b8d20d9 Mon Sep 17 00:00:00 2001 From: zxhlyh Date: Tue, 22 Jul 2025 10:39:19 +0800 Subject: [PATCH] datasource auth --- .../data-source-page-new/card.tsx | 4 +- .../data-source-page-new/operator.tsx | 69 ++++++++++--------- web/i18n/en-US/plugin.ts | 2 + web/i18n/zh-Hans/plugin.ts | 2 + 4 files changed, 41 insertions(+), 36 deletions(-) diff --git a/web/app/components/header/account-setting/data-source-page-new/card.tsx b/web/app/components/header/account-setting/data-source-page-new/card.tsx index 31f9ef6961..49a125b267 100644 --- a/web/app/components/header/account-setting/data-source-page-new/card.tsx +++ b/web/app/components/header/account-setting/data-source-page-new/card.tsx @@ -109,7 +109,7 @@ const Card = ({ />
- Connected workspace + {t('plugin.auth.connectedWorkspace')}
{ @@ -131,7 +131,7 @@ const Card = ({ !credentials_list.length && (
- Please configure authentication + {t('plugin.auth.emptyAuth')}
) diff --git a/web/app/components/header/account-setting/data-source-page-new/operator.tsx b/web/app/components/header/account-setting/data-source-page-new/operator.tsx index 9a4bc0c41a..60dd32f904 100644 --- a/web/app/components/header/account-setting/data-source-page-new/operator.tsx +++ b/web/app/components/header/account-setting/data-source-page-new/operator.tsx @@ -9,7 +9,6 @@ import { RiEditLine, RiEqualizer2Line, RiHome9Line, - RiLoopLeftLine, RiStickyNoteAddLine, } from '@remixicon/react' import Dropdown from '@/app/components/base/dropdown' @@ -44,45 +43,45 @@ const Operator = ({ ), }, - { - value: 'rename', - text: ( -
- -
{t('common.operation.rename')}
-
- ), - }, - { - value: 'edit', - text: ( -
- -
{t('common.operation.edit')}
-
- ), - }, + ...( + type === CredentialTypeEnum.OAUTH2 + ? [ + { + value: 'rename', + text: ( +
+ +
{t('common.operation.rename')}
+
+ ), + }, + ] + : [] + ), + ...( + type === CredentialTypeEnum.API_KEY + ? [ + { + value: 'edit', + text: ( +
+ +
{t('common.operation.edit')}
+
+ ), + }, + ] + : [] + ), ] if (type === CredentialTypeEnum.OAUTH2) { const oAuthItems = [ { value: 'change', - text: ( -
- -
-
{t('common.dataSource.notion.changeAuthorizedPages')}
-
18 {t('common.dataSource.notion.pagesAuthorized')}
-
-
- ), - }, - { - value: 'sync', text: (
- -
{t('common.dataSource.notion.sync')}
+ +
{t('common.dataSource.notion.changeAuthorizedPages')}
), }, @@ -99,7 +98,9 @@ const Operator = ({ text: (
-
Remove
+
+ {t('common.operation.remove')} +
), }, diff --git a/web/i18n/en-US/plugin.ts b/web/i18n/en-US/plugin.ts index 11815e5035..020db2daf5 100644 --- a/web/i18n/en-US/plugin.ts +++ b/web/i18n/en-US/plugin.ts @@ -238,6 +238,8 @@ const translation = { authRemoved: 'Auth removed', clientInfo: 'As no system client secrets found for this tool provider, setup it manually is required, for redirect_uri, please use', oauthClient: 'OAuth Client', + connectedWorkspace: 'Connected Workspace', + emptyAuth: 'Please configure authentication', }, } diff --git a/web/i18n/zh-Hans/plugin.ts b/web/i18n/zh-Hans/plugin.ts index dfce793ece..dfb717b948 100644 --- a/web/i18n/zh-Hans/plugin.ts +++ b/web/i18n/zh-Hans/plugin.ts @@ -238,6 +238,8 @@ const translation = { authRemoved: '凭据已移除', clientInfo: '由于未找到此工具提供者的系统客户端密钥,因此需要手动设置,对于 redirect_uri,请使用', oauthClient: 'OAuth 客户端', + connectedWorkspace: '已连接的工作区', + emptyAuth: '请配置身份验证', }, }