fix: not auther tool in readonly mode

This commit is contained in:
Joel 2025-11-18 11:02:46 +08:00
parent 67b0771081
commit b6bdcc7052

View File

@ -119,7 +119,7 @@ const AgentTools: FC = () => {
} }
const getProviderShowName = (item: AgentTool) => { const getProviderShowName = (item: AgentTool) => {
const type = item.provider_type const type = item.provider_type
if(type === CollectionType.builtIn) if (type === CollectionType.builtIn)
return item.provider_name.split('/').pop() return item.provider_name.split('/').pop()
return item.provider_name return item.provider_name
} }
@ -291,10 +291,14 @@ const AgentTools: FC = () => {
}} /> }} />
)} )}
{item.notAuthor && ( {item.notAuthor && (
<Button variant='secondary' size='small' onClick={() => { <Button
setCurrentTool(item) variant='secondary'
setIsShowSettingTool(true) disabled={readonly}
}}> size='small' onClick={() => {
setCurrentTool(item)
setIsShowSettingTool(true)
}}
>
{t('tools.notAuthorized')} {t('tools.notAuthorized')}
<Indicator className='ml-2' color='orange' /> <Indicator className='ml-2' color='orange' />
</Button> </Button>