Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions web/src/pages/providers/components/custom-config-step.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,36 +225,36 @@ export function CustomConfigStep() {
<h3 className="text-lg font-semibold text-text-primary border-b border-border pb-2">
{t('provider.errorCooldownTitle')}
</h3>
<div className="space-y-4">
<div className="flex items-center justify-between p-4 bg-card border border-border rounded-xl">
<div className="pr-4">
<div className="text-sm font-medium text-foreground">
{t('provider.disableErrorCooldown')}
</div>
<p className="text-xs text-muted-foreground mt-1">
{t('provider.disableErrorCooldownDesc')}
</p>
<div className="flex items-center justify-between p-4 bg-card border border-border rounded-xl">
<div className="pr-4">
<div className="text-sm font-medium text-foreground">
{t('provider.disableErrorCooldown')}
</div>
<Switch
checked={!!formData.disableErrorCooldown}
onCheckedChange={(checked) => updateFormData({ disableErrorCooldown: checked })}
/>
<p className="text-xs text-muted-foreground mt-1">
{t('provider.disableErrorCooldownDesc')}
</p>
</div>
<Switch
checked={!!formData.disableErrorCooldown}
onCheckedChange={(checked) => updateFormData({ disableErrorCooldown: checked })}
/>
</div>
</div>

<div className="flex items-center justify-between p-4 bg-card border border-border rounded-xl">
<div className="pr-4">
<div className="text-sm font-medium text-foreground">
{t('provider.excludeFromExport')}
</div>
<p className="text-xs text-muted-foreground mt-1">
{t('provider.excludeFromExportDesc')}
</p>
</div>
<Switch
checked={!!formData.excludeFromExport}
onCheckedChange={(checked) => updateFormData({ excludeFromExport: checked })}
/>
<div className="space-y-6">
<h3 className="text-lg font-semibold text-text-primary border-b border-border pb-2">
{t('provider.excludeFromExport')}
</h3>
<div className="flex items-center justify-between p-4 bg-card border border-border rounded-xl">
<div className="pr-4">
<p className="text-xs text-muted-foreground mt-1">
{t('provider.excludeFromExportDesc')}
</p>
</div>
<Switch
checked={!!formData.excludeFromExport}
onCheckedChange={(checked) => updateFormData({ excludeFromExport: checked })}
/>
</div>
</div>

Expand Down
49 changes: 26 additions & 23 deletions web/src/pages/providers/components/provider-edit-flow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ export function ProviderEditFlow({ provider, onClose }: ProviderEditFlowProps) {
};

const [showApiKey, setShowApiKey] = useState(false);
const shouldShowApiKeyField = !provider.excludeFromExport;
const [formData, setFormData] = useState<EditFormData>({
name: provider.name,
baseURL: provider.config?.custom?.baseURL || '',
Expand Down Expand Up @@ -658,31 +659,33 @@ export function ProviderEditFlow({ provider, onClose }: ProviderEditFlowProps) {
</p>
</div>

<div>
<label className="text-sm font-medium text-foreground block mb-2">
<div className="flex items-center gap-2">
<Key size={14} />
<span>{t('provider.apiKeyEdit')}</span>
{shouldShowApiKeyField && (
<div>
<label className="text-sm font-medium text-foreground block mb-2">
<div className="flex items-center gap-2">
<Key size={14} />
<span>{t('provider.apiKeyEdit')}</span>
</div>
</label>
<div className="relative">
<Input
type={showApiKey ? 'text' : 'password'}
value={formData.apiKey}
onChange={(e) => setFormData((prev) => ({ ...prev, apiKey: e.target.value }))}
placeholder={t('provider.keyPlaceholder')}
className="w-full pr-10"
/>
<button
type="button"
onClick={() => setShowApiKey(!showApiKey)}
className="absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors"
tabIndex={-1}
>
{showApiKey ? <EyeOff className="h-4 w-4" /> : <Eye className="h-4 w-4" />}
</button>
</div>
</label>
<div className="relative">
<Input
type={showApiKey ? 'text' : 'password'}
value={formData.apiKey}
onChange={(e) => setFormData((prev) => ({ ...prev, apiKey: e.target.value }))}
placeholder={t('provider.keyPlaceholder')}
className="w-full pr-10"
/>
<button
type="button"
onClick={() => setShowApiKey(!showApiKey)}
className="absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors"
tabIndex={-1}
>
{showApiKey ? <EyeOff className="h-4 w-4" /> : <Eye className="h-4 w-4" />}
</button>
</div>
</div>
)}
</div>
</div>
</div>
Expand Down
Loading