From 12d20541e28e688c1ee1e87a1cba5fad7c09ab28 Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Thu, 2 Oct 2025 06:14:39 +0000 Subject: [PATCH] Improve OpenRouter API key configuration persistence and UI feedback Update the settings page to properly persist the OpenRouter API key, provide visual feedback on existing configurations, and adjust save button logic based on configuration status. Replit-Commit-Author: Agent Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/35Hxx7C --- client/src/pages/settings.tsx | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/client/src/pages/settings.tsx b/client/src/pages/settings.tsx index a0b05b7..d1bcf1a 100644 --- a/client/src/pages/settings.tsx +++ b/client/src/pages/settings.tsx @@ -51,6 +51,9 @@ export default function Settings() { } }, [openrouterConfig]); + // Vérifier si une config OpenRouter existe déjà + const hasExistingConfig = !!openrouterConfig; + const saveCloudinaryMutation = useMutation({ mutationFn: () => apiRequest('POST', '/api/cloudinary/config', { @@ -187,14 +190,22 @@ export default function Settings() { type="password" value={openrouterApiKey} onChange={(e) => setOpenrouterApiKey(e.target.value)} - placeholder="sk-or-v1-..." + placeholder={hasExistingConfig ? "••••••••••••••••" : "sk-or-v1-..."} data-testid="input-openrouter-api-key" />
- Obtenez votre clé API sur{" "} - - openrouter.ai - + {hasExistingConfig ? ( + <> + ✓ Clé API configurée - Laissez vide pour garder la clé actuelle + > + ) : ( + <> + Obtenez votre clé API sur{" "} + + openrouter.ai + + > + )}