+
+ {t('agent.providerType')}
+
+ {PROVIDER_TYPES.map((type) => {
+ const active = selectedTypeId === type.id;
+ return (
+
+ );
+ })}
+
+
+ {/* Right: form */}
+
+ {error &&
{error}
}
+ {testResult && (
+
+ {testResult.success
+ ? `${t('agent.providerTestSuccess')} · ${testResult.model_count} ${t('agent.providerModels')}`
+ : `${t('agent.providerTestFailed')}: ${testResult.error}`}
+
+ )}
+
+
+
+ setFormData({ ...formData, provider_title: e.target.value })}
+ placeholder={t('agent.providerTitlePlaceholder')}
+ disabled={!!editingProvider}
+ className="w-full bg-bg-input border border-border-primary text-sm rounded-xl px-3.5 py-2.5 focus:outline-none focus:ring-2 focus:ring-accent/20 focus:border-accent text-text-primary placeholder:text-text-muted/50 disabled:opacity-50"
+ />
+
+
+
+
+
setFormData({ ...formData, provider_url: e.target.value })}
+ placeholder={selectedType.defaultUrl || t('agent.baseUrlPlaceholder')}
+ className="w-full bg-bg-input border border-border-primary text-sm rounded-xl px-3.5 py-2.5 focus:outline-none focus:ring-2 focus:ring-accent/20 focus:border-accent text-text-primary placeholder:text-text-muted/50 font-mono"
+ />
+ {selectedType.defaultUrl && !editingProvider && (
+
+ {t('agent.baseUrlHint')}: {selectedType.defaultUrl}
+
+ )}
+
+
+
+
+ setFormData({ ...formData, provider_apikey: e.target.value })}
+ placeholder={editingProvider ? t('agent.apiKeyEditPlaceholder') : t('agent.apiKeyPlaceholder')}
+ className="w-full bg-bg-input border border-border-primary text-sm rounded-xl px-3.5 py-2.5 focus:outline-none focus:ring-2 focus:ring-accent/20 focus:border-accent text-text-primary placeholder:text-text-muted/50 font-mono"
+ />
+
+
+ {/* 参数设置 — collapsible */}
+
+
+ {showAdvanced && (
+
+
+
+
+
+ )}
- ))}
-
-
-
+
+ {/* Footer */}
+
+
+
+
+
+
+