datasource auth

feat/rag-2
zxhlyh 9 months ago
parent e5c7fd5b14
commit 10657b6bd3

@ -109,7 +109,7 @@ const Card = ({
/> />
</div> </div>
<div className='system-xs-medium flex h-4 items-center pl-3 text-text-tertiary'> <div className='system-xs-medium flex h-4 items-center pl-3 text-text-tertiary'>
Connected workspace {t('plugin.auth.connectedWorkspace')}
<div className='ml-3 h-[1px] grow bg-divider-subtle'></div> <div className='ml-3 h-[1px] grow bg-divider-subtle'></div>
</div> </div>
{ {
@ -131,7 +131,7 @@ const Card = ({
!credentials_list.length && ( !credentials_list.length && (
<div className='p-3 pt-1'> <div className='p-3 pt-1'>
<div className='system-xs-regular flex h-10 items-center justify-center rounded-[10px] bg-background-section text-text-tertiary'> <div className='system-xs-regular flex h-10 items-center justify-center rounded-[10px] bg-background-section text-text-tertiary'>
Please configure authentication {t('plugin.auth.emptyAuth')}
</div> </div>
</div> </div>
) )

@ -9,7 +9,6 @@ import {
RiEditLine, RiEditLine,
RiEqualizer2Line, RiEqualizer2Line,
RiHome9Line, RiHome9Line,
RiLoopLeftLine,
RiStickyNoteAddLine, RiStickyNoteAddLine,
} from '@remixicon/react' } from '@remixicon/react'
import Dropdown from '@/app/components/base/dropdown' import Dropdown from '@/app/components/base/dropdown'
@ -44,45 +43,45 @@ const Operator = ({
</div> </div>
), ),
}, },
{ ...(
value: 'rename', type === CredentialTypeEnum.OAUTH2
text: ( ? [
<div className='flex items-center'> {
<RiEditLine className='mr-2 h-4 w-4 text-text-tertiary' /> value: 'rename',
<div className='system-sm-semibold text-text-secondary'>{t('common.operation.rename')}</div> text: (
</div> <div className='flex items-center'>
), <RiEditLine className='mr-2 h-4 w-4 text-text-tertiary' />
}, <div className='system-sm-semibold text-text-secondary'>{t('common.operation.rename')}</div>
{ </div>
value: 'edit', ),
text: ( },
<div className='flex items-center'> ]
<RiEqualizer2Line className='mr-2 h-4 w-4 text-text-tertiary' /> : []
<div className='system-sm-semibold text-text-secondary'>{t('common.operation.edit')}</div> ),
</div> ...(
), type === CredentialTypeEnum.API_KEY
}, ? [
{
value: 'edit',
text: (
<div className='flex items-center'>
<RiEqualizer2Line className='mr-2 h-4 w-4 text-text-tertiary' />
<div className='system-sm-semibold text-text-secondary'>{t('common.operation.edit')}</div>
</div>
),
},
]
: []
),
] ]
if (type === CredentialTypeEnum.OAUTH2) { if (type === CredentialTypeEnum.OAUTH2) {
const oAuthItems = [ const oAuthItems = [
{ {
value: 'change', value: 'change',
text: (
<div className='flex'>
<RiStickyNoteAddLine className='mr-2 h-4 w-4 text-text-tertiary' />
<div>
<div className='system-sm-semibold mb-1 text-text-secondary'>{t('common.dataSource.notion.changeAuthorizedPages')}</div>
<div className='system-xs-regular text-text-tertiary'>18 {t('common.dataSource.notion.pagesAuthorized')}</div>
</div>
</div>
),
},
{
value: 'sync',
text: ( text: (
<div className='flex items-center'> <div className='flex items-center'>
<RiLoopLeftLine className='mr-2 h-4 w-4 text-text-tertiary' /> <RiStickyNoteAddLine className='mr-2 h-4 w-4 text-text-tertiary' />
<div className='system-sm-semibold text-text-secondary'>{t('common.dataSource.notion.sync')}</div> <div className='system-sm-semibold mb-1 text-text-secondary'>{t('common.dataSource.notion.changeAuthorizedPages')}</div>
</div> </div>
), ),
}, },
@ -99,7 +98,9 @@ const Operator = ({
text: ( text: (
<div className='flex items-center'> <div className='flex items-center'>
<RiDeleteBinLine className='mr-2 h-4 w-4 text-text-tertiary' /> <RiDeleteBinLine className='mr-2 h-4 w-4 text-text-tertiary' />
<div className='system-sm-semibold text-text-secondary'>Remove</div> <div className='system-sm-semibold text-text-secondary'>
{t('common.operation.remove')}
</div>
</div> </div>
), ),
}, },

@ -238,6 +238,8 @@ const translation = {
authRemoved: 'Auth removed', authRemoved: 'Auth removed',
clientInfo: 'As no system client secrets found for this tool provider, setup it manually is required, for redirect_uri, please use', clientInfo: 'As no system client secrets found for this tool provider, setup it manually is required, for redirect_uri, please use',
oauthClient: 'OAuth Client', oauthClient: 'OAuth Client',
connectedWorkspace: 'Connected Workspace',
emptyAuth: 'Please configure authentication',
}, },
} }

@ -238,6 +238,8 @@ const translation = {
authRemoved: '凭据已移除', authRemoved: '凭据已移除',
clientInfo: '由于未找到此工具提供者的系统客户端密钥,因此需要手动设置,对于 redirect_uri请使用', clientInfo: '由于未找到此工具提供者的系统客户端密钥,因此需要手动设置,对于 redirect_uri请使用',
oauthClient: 'OAuth 客户端', oauthClient: 'OAuth 客户端',
connectedWorkspace: '已连接的工作区',
emptyAuth: '请配置身份验证',
}, },
} }

Loading…
Cancel
Save