fix: privilege for editor role (#6521)
This commit is contained in:
parent
a67831773f
commit
87d583f454
5 changed files with 23 additions and 13 deletions
|
|
@ -25,6 +25,7 @@ import { ChevronDownDouble } from '@/app/components/base/icons/src/vender/line/a
|
|||
import { fetchModelProviderModelList } from '@/service/common'
|
||||
import { useEventEmitterContextContext } from '@/context/event-emitter'
|
||||
import { IS_CE_EDITION } from '@/config'
|
||||
import { useAppContext } from '@/context/app-context'
|
||||
|
||||
export const UPDATE_MODEL_PROVIDER_CUSTOM_MODEL_LIST = 'UPDATE_MODEL_PROVIDER_CUSTOM_MODEL_LIST'
|
||||
type ProviderAddedCardProps = {
|
||||
|
|
@ -44,6 +45,7 @@ const ProviderAddedCard: FC<ProviderAddedCardProps> = ({
|
|||
const configurationMethods = provider.configurate_methods.filter(method => method !== ConfigurationMethodEnum.fetchFromRemote)
|
||||
const systemConfig = provider.system_configuration
|
||||
const hasModelList = fetched && !!modelList.length
|
||||
const { isCurrentWorkspaceManager } = useAppContext()
|
||||
const showQuota = systemConfig.enabled && [...MODEL_PROVIDER_QUOTA_GET_PAID].includes(provider.provider) && !IS_CE_EDITION
|
||||
|
||||
const getModelList = async (providerName: string) => {
|
||||
|
|
@ -103,7 +105,7 @@ const ProviderAddedCard: FC<ProviderAddedCardProps> = ({
|
|||
)
|
||||
}
|
||||
{
|
||||
configurationMethods.includes(ConfigurationMethodEnum.predefinedModel) && (
|
||||
configurationMethods.includes(ConfigurationMethodEnum.predefinedModel) && isCurrentWorkspaceManager && (
|
||||
<CredentialPanel
|
||||
onSetup={() => onOpenModal(ConfigurationMethodEnum.predefinedModel)}
|
||||
provider={provider}
|
||||
|
|
@ -138,7 +140,7 @@ const ProviderAddedCard: FC<ProviderAddedCardProps> = ({
|
|||
}
|
||||
</div>
|
||||
{
|
||||
configurationMethods.includes(ConfigurationMethodEnum.customizableModel) && (
|
||||
configurationMethods.includes(ConfigurationMethodEnum.customizableModel) && isCurrentWorkspaceManager && (
|
||||
<AddModelButton
|
||||
onClick={() => onOpenModal(ConfigurationMethodEnum.customizableModel)}
|
||||
className='hidden group-hover:flex group-hover:text-primary-600'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue