From 2cb77f2dfd8376905e76cdd951830d24f2d29bbf Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Thu, 22 Jan 2026 14:24:37 -0500 Subject: [PATCH] feat(ui): add Ollama logo and make API key optional - Add Ollama SVG logo to ui/public/icons/ - Add icon property to both ollama and ollama-cloud presets - Make API key field optional for local Ollama (show input with hint) - Update placeholder: "Optional - only if auth is enabled" - Allows power users with Ollama auth configured to provide key --- ui/public/icons/ollama.svg | 1 + .../profiles/profile-create-dialog.tsx | 91 ++++++++++--------- ui/src/lib/provider-presets.ts | 2 + 3 files changed, 49 insertions(+), 45 deletions(-) create mode 100644 ui/public/icons/ollama.svg diff --git a/ui/public/icons/ollama.svg b/ui/public/icons/ollama.svg new file mode 100644 index 00000000..cc887e3d --- /dev/null +++ b/ui/public/icons/ollama.svg @@ -0,0 +1 @@ +Ollama \ No newline at end of file diff --git a/ui/src/components/profiles/profile-create-dialog.tsx b/ui/src/components/profiles/profile-create-dialog.tsx index 0d7fff12..2c3d283a 100644 --- a/ui/src/components/profiles/profile-create-dialog.tsx +++ b/ui/src/components/profiles/profile-create-dialog.tsx @@ -215,8 +215,8 @@ export function ProfileCreateDialog({ // Use user-provided baseUrl (allows customization of preset URLs) const finalData = { ...data, - // For presets that don't require API key, use empty string - apiKey: currentPreset?.requiresApiKey === false ? '' : data.apiKey, + // Use provided API key, or empty string if not provided (for optional auth providers) + apiKey: data.apiKey || '', }; try { await createMutation.mutateAsync(finalData); @@ -374,51 +374,52 @@ export function ProfileCreateDialog({ )} - {/* API Key - hidden for presets that don't require it */} - {currentPreset?.requiresApiKey !== false ? ( -
- -
- - -
- {errors.apiKey ? ( -

{errors.apiKey.message}

- ) : ( - currentPreset?.apiKeyHint && ( -

{currentPreset.apiKeyHint}

- ) + {/* API Key - optional for presets that don't require it */} +
+ +
+ +
- ) : ( -
- -
-

No API Key Required

-

- {currentPreset?.apiKeyHint || - 'This provider runs locally and does not require authentication.'} -

-
-
- )} + {errors.apiKey ? ( +

{errors.apiKey.message}

+ ) : currentPreset?.requiresApiKey === false ? ( +

+ Only needed if you have configured Ollama authentication +

+ ) : ( + currentPreset?.apiKeyHint && ( +

{currentPreset.apiKeyHint}

+ ) + )} +
diff --git a/ui/src/lib/provider-presets.ts b/ui/src/lib/provider-presets.ts index 2cd68f18..4b900e4a 100644 --- a/ui/src/lib/provider-presets.ts +++ b/ui/src/lib/provider-presets.ts @@ -53,6 +53,7 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [ defaultProfileName: 'ollama', badge: 'Local', featured: true, + icon: '/icons/ollama.svg', defaultModel: 'qwen3-coder', requiresApiKey: false, apiKeyPlaceholder: '', @@ -158,6 +159,7 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [ baseUrl: 'https://ollama.com', defaultProfileName: 'ollama-cloud', badge: 'Cloud', + icon: '/icons/ollama.svg', defaultModel: 'glm-4.7:cloud', requiresApiKey: true, apiKeyPlaceholder: 'YOUR_OLLAMA_CLOUD_API_KEY',