Fix/2969 add model provider ollama not work (#2973)

This commit is contained in:
crazywoola
2024-03-26 10:26:34 +08:00
committed by GitHub
parent 7c8c233cf4
commit eeaa3c1643
9 changed files with 309 additions and 133 deletions

View File

@@ -161,7 +161,7 @@ const Form: FC<FormProps> = ({
flex justify-center items-center mr-2 w-4 h-4 border border-gray-300 rounded-full
${value[variable] === option.value && 'border-[5px] border-primary-600'}
`} />
<div className='text-sm text-gray-900'>{option.label[language]}</div>
<div className='text-sm text-gray-900'>{option.label[language] || option.label.en_US}</div>
</div>
))
}
@@ -206,9 +206,9 @@ const Form: FC<FormProps> = ({
return option.show_on.every(showOnItem => value[showOnItem.variable] === showOnItem.value)
return true
}).map(option => ({ value: option.value, name: option.label[language] }))}
}).map(option => ({ value: option.value, name: option.label[language] || option.label.en_US }))}
onSelect={item => handleFormChange(variable, item.value as string)}
placeholder={placeholder?.[language]}
placeholder={placeholder?.[language] || placeholder?.en_US}
/>
{fieldMoreInfo?.(formSchema)}
{validating && changeKey === variable && <ValidatingTip />}

View File

@@ -219,7 +219,7 @@ const ModelModal: FC<ModelModalProps> = ({
const renderTitlePrefix = () => {
const prefix = configurateMethod === ConfigurateMethodEnum.customizableModel ? t('common.operation.add') : t('common.operation.setup')
return `${prefix} ${provider.label[language]}`
return `${prefix} ${provider.label[language] || provider.label.en_US}`
}
return (

View File

@@ -116,11 +116,11 @@ const ProviderCard: FC<ProviderCardProps> = ({
return (
<Button
key={method}
className='h-7 bg-white text-xs text-gray-700'
className={'h-7 bg-white text-xs text-gray-700 shrink-0'}
onClick={() => onOpenModal(method)}
>
<Settings01 className='mr-[5px] w-3.5 h-3.5' />
{t('common.operation.setup')}
<Settings01 className={`mr-[5px] w-3.5 h-3.5 ${s.icon}`} />
<span className='text-xs inline-flex items-center justify-center overflow-ellipsis shrink-0'>{t('common.operation.setup')}</span>
</Button>
)
}

View File

@@ -25,7 +25,7 @@ const ProviderIcon: FC<ProviderIconProps> = ({
return (
<div className={`inline-flex items-center ${className}`}>
<div className='text-xs font-semibold text-black'>
{provider.label[language]}
{provider.label[language] || provider.label.en_US}
</div>
</div>
)