tool empty list

This commit is contained in:
jZonG 2025-05-08 20:39:58 +08:00
parent 1bb70f9af9
commit 27c27223e1
3 changed files with 54 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import { useTranslation } from 'react-i18next'
import { useAppContext } from '@/context/app-context' import { useAppContext } from '@/context/app-context'
import { import {
RiCloseLine, RiCloseLine,
RiLoader2Line,
} from '@remixicon/react' } from '@remixicon/react'
import type { ToolWithProvider } from '../../../workflow/types' import type { ToolWithProvider } from '../../../workflow/types'
import Icon from '@/app/components/plugins/card/base/card-icon' import Icon from '@/app/components/plugins/card/base/card-icon'
@ -123,12 +124,43 @@ const MCPDetailContent: FC<Props> = ({
className='w-full' className='w-full'
// onClick={() => setShowSettingAuth(true)} // onClick={() => setShowSettingAuth(true)}
disabled={!isCurrentWorkspaceManager} disabled={!isCurrentWorkspaceManager}
>{t('tools.auth.unauthorized')}</Button> >
{t('tools.mcp.authorize')}
</Button>
)}
{/* TODO */}
{deleting && (
<Button
variant='primary'
className='w-full'
// onClick={() => setShowSettingAuth(true)}
disabled
>
<RiLoader2Line className={cn('mr-1 h-4 w-4 animate-spin')} />
{t('tools.mcp.authorizing')}
</Button>
)} )}
</div> </div>
</div> </div>
<div className='grow overflow-y-auto'> <div className='grow overflow-y-auto'>
TOOL list {!detail.is_team_authorization && (
<div className='flex h-full w-full flex-col items-center justify-center'>
<div className='system-md-medium mb-1 text-text-secondary'>{t('tools.mcp.authorizingRequired')}</div>
{deleting && <div className='system-md-medium mb-1 text-text-secondary'>{t('tools.mcp.authorizing')}</div>}
<div className='system-sm-regular text-text-tertiary'>{t('tools.mcp.authorizeTip')}</div>
</div>
)}
{detail.is_team_authorization && (
<div className='flex h-full w-full flex-col items-center justify-center'>
<div className='system-sm-regular mb-3 text-text-tertiary'>{t('tools.mcp.toolsEmpty')}</div>
<Button
variant='primary'
onClick={() => {
// TODO
}}
>{t('tools.mcp.getTools')}</Button>
</div>
)}
</div> </div>
{isShowUpdateModal && ( {isShowUpdateModal && (
<MCPModal <MCPModal

View File

@ -178,6 +178,16 @@ const translation = {
edit: 'Edit', edit: 'Edit',
remove: 'Remove', remove: 'Remove',
}, },
authorize: 'Authorize',
authorizing: 'Authorizing...',
authorizingRequired: 'Authorization is required',
authorizeTip: 'After authorization, tools will be displayed here.',
update: 'Update',
updating: 'Updating',
gettingTools: 'Getting Tools',
updateTools: 'Updating Tools',
toolsEmpty: 'Tools not loaded',
getTools: 'Get tools',
}, },
} }

View File

@ -178,6 +178,16 @@ const translation = {
edit: '修改', edit: '修改',
remove: '删除', remove: '删除',
}, },
authorize: '授权',
authorizing: '授权中...',
authorizingRequired: '需要授权',
authorizeTip: '授权后,工具将显示在这里。',
update: '更新',
updating: '更新中',
gettingTools: '获取工具中...',
updateTools: '更新工具中...',
toolsEmpty: '工具未加载',
getTools: '获取工具',
}, },
} }