feat(model): opt model provider doc url (#475)
This commit is contained in:
@@ -31,6 +31,7 @@ import {
|
||||
} from '@/stores/providers';
|
||||
import {
|
||||
PROVIDER_TYPE_INFO,
|
||||
getProviderDocsUrl,
|
||||
type ProviderType,
|
||||
getProviderIconUrl,
|
||||
resolveProviderApiKeyForSave,
|
||||
@@ -318,6 +319,7 @@ function ProviderCard({
|
||||
const [saving, setSaving] = useState(false);
|
||||
|
||||
const typeInfo = PROVIDER_TYPE_INFO.find((t) => t.id === account.vendorId);
|
||||
const providerDocsUrl = getProviderDocsUrl(typeInfo, i18n.language);
|
||||
const showModelIdField = shouldShowProviderModelId(typeInfo, devModeUnlocked);
|
||||
const canEditModelConfig = Boolean(typeInfo?.showBaseUrl || showModelIdField);
|
||||
|
||||
@@ -522,12 +524,10 @@ function ProviderCard({
|
||||
|
||||
{isEditing && (
|
||||
<div className="space-y-6 mt-4 pt-4 border-t border-black/5 dark:border-white/5">
|
||||
{account.vendorId === 'custom' && (
|
||||
{providerDocsUrl && (
|
||||
<div className="flex justify-end -mt-2 mb-2">
|
||||
<a
|
||||
href={i18n.language.startsWith('zh')
|
||||
? 'https://icnnp7d0dymg.feishu.cn/wiki/BmiLwGBcEiloZDkdYnGc8RWnn6d#IWQCdfe5fobGU3xf3UGcgbLynGh'
|
||||
: 'https://icnnp7d0dymg.feishu.cn/wiki/BmiLwGBcEiloZDkdYnGc8RWnn6d#Ee1ldfvKJoVGvfxc32mcILwenth'}
|
||||
href={providerDocsUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-[12px] text-blue-500 hover:text-blue-600 font-medium inline-flex items-center gap-1"
|
||||
@@ -799,6 +799,7 @@ function AddProviderDialog({
|
||||
const [authMode, setAuthMode] = useState<'oauth' | 'apikey'>('apikey');
|
||||
|
||||
const typeInfo = PROVIDER_TYPE_INFO.find((t) => t.id === selectedType);
|
||||
const providerDocsUrl = getProviderDocsUrl(typeInfo, i18n.language);
|
||||
const showModelIdField = shouldShowProviderModelId(typeInfo, devModeUnlocked);
|
||||
const isOAuth = typeInfo?.isOAuth ?? false;
|
||||
const supportsApiKey = typeInfo?.supportsApiKey ?? false;
|
||||
@@ -1092,13 +1093,11 @@ function AddProviderDialog({
|
||||
>
|
||||
{t('aiProviders.dialog.change')}
|
||||
</button>
|
||||
{selectedType === 'custom' && (
|
||||
{providerDocsUrl && (
|
||||
<>
|
||||
<span className="mx-2 text-foreground/20">|</span>
|
||||
<a
|
||||
href={i18n.language.startsWith('zh')
|
||||
? 'https://icnnp7d0dymg.feishu.cn/wiki/BmiLwGBcEiloZDkdYnGc8RWnn6d#IWQCdfe5fobGU3xf3UGcgbLynGh'
|
||||
: 'https://icnnp7d0dymg.feishu.cn/wiki/BmiLwGBcEiloZDkdYnGc8RWnn6d#Ee1ldfvKJoVGvfxc32mcILwenth'}
|
||||
href={providerDocsUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-[13px] text-blue-500 hover:text-blue-600 font-medium inline-flex items-center gap-1"
|
||||
|
||||
Reference in New Issue
Block a user