Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions web/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,7 @@
"apiEndpoint": "API Endpoint",
"apiKey": "API Key",
"apiKeyEdit": "API Key (leave empty to keep current)",
"apiKeyExcludedHint": "This provider is excluded from export and backup. You can still rotate the API key here; it just won't be included in exported files or backup packages.",
"optionalUrlNote": "Optional if client-specific URLs are set below.",
"namePlaceholder": "e.g. Production OpenAI",
"endpointPlaceholder": "https://api.openai.com/v1",
Expand Down
1 change: 1 addition & 0 deletions web/src/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,7 @@
"apiEndpoint": "API 端点",
"apiKey": "API 密钥",
"apiKeyEdit": "API 密钥(留空保持当前值)",
"apiKeyExcludedHint": "该提供商已设置为“从导出与备份中排除”。您仍可在这里轮换 API 密钥,只是它不会被写入导出文件或系统备份。",
"optionalUrlNote": "如果下面设置了客户端特定的 URL,则此项为可选。",
"namePlaceholder": "例如:Production OpenAI",
"endpointPlaceholder": "https://api.openai.com/v1",
Expand Down
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
7 changes: 6 additions & 1 deletion web/src/pages/providers/components/provider-edit-flow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -677,11 +677,16 @@ export function ProviderEditFlow({ provider, onClose }: ProviderEditFlowProps) {
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}
aria-label={showApiKey ? t('common.hide') : t('common.show')}
>
{showApiKey ? <EyeOff className="h-4 w-4" /> : <Eye className="h-4 w-4" />}
</button>
</div>
{provider.excludeFromExport && (
<div className="mt-2 p-3 bg-muted/50 border border-border rounded-lg text-xs text-muted-foreground">
{t('provider.apiKeyExcludedHint')}
</div>
)}
</div>
</div>
</div>
Expand Down
Loading