need author judgement

This commit is contained in:
JzoNg 2024-11-02 14:55:57 +08:00
parent ef00ad0417
commit cee51ac084
2 changed files with 18 additions and 16 deletions

View File

@ -36,7 +36,7 @@ const ActionList = () => {
<div className='mb-1 py-1'>
<div className='mb-1 h-6 flex items-center justify-between text-text-secondary system-sm-semibold-uppercase'>
{t('plugin.detailPanel.actionNum', { num: data.length })}
{providerDeclaration.is_team_authorization && (
{providerDeclaration.is_team_authorization && providerDeclaration.allow_delete && (
<Button
variant='secondary'
size='small'
@ -48,7 +48,7 @@ const ActionList = () => {
</Button>
)}
</div>
{!providerDeclaration.is_team_authorization && (
{!providerDeclaration.is_team_authorization && providerDeclaration.allow_delete && (
<Button
variant='primary'
className='w-full'

View File

@ -45,7 +45,7 @@ import { ConfigurationMethodEnum } from '@/app/components/header/account-setting
import Loading from '@/app/components/base/loading'
import { useAppContext } from '@/context/app-context'
interface Props {
type Props = {
collection: Collection
onHide: () => void
onRefreshData: () => void
@ -293,21 +293,23 @@ const ProviderDetail = ({
<div className='pt-3'>
{isDetailLoading && <div className='flex h-[200px]'><Loading type='app' /></div>}
{/* Builtin type */}
{!isDetailLoading && (collection.type === CollectionType.builtIn) && needAuth && isAuthed && (
{!isDetailLoading && (collection.type === CollectionType.builtIn) && isAuthed && (
<div className='mb-1 h-6 flex items-center justify-between text-text-secondary system-sm-semibold-uppercase'>
{t('plugin.detailPanel.actionNum', { num: 3 })}
<Button
variant='secondary'
size='small'
onClick={() => {
if (collection.type === CollectionType.builtIn || collection.type === CollectionType.model)
showSettingAuthModal()
}}
disabled={!isCurrentWorkspaceManager}
>
<Indicator className='mr-2' color={'green'} />
{t('tools.auth.authorized')}
</Button>
{needAuth && (
<Button
variant='secondary'
size='small'
onClick={() => {
if (collection.type === CollectionType.builtIn || collection.type === CollectionType.model)
showSettingAuthModal()
}}
disabled={!isCurrentWorkspaceManager}
>
<Indicator className='mr-2' color={'green'} />
{t('tools.auth.authorized')}
</Button>
)}
</div>
)}
{!isDetailLoading && (collection.type === CollectionType.builtIn) && needAuth && !isAuthed && (