Skip to content

Commit 465dd2f

Browse files
committed
fix: use VSCodeTextField for Ollama API key field
Remove non-existent ApiKeyField import and use standard VSCodeTextField with password type, matching other provider implementations
1 parent 2b8cdb7 commit 465dd2f

File tree

1 file changed

+11
-8
lines changed
  • webview-ui/src/components/settings/providers

1 file changed

+11
-8
lines changed

webview-ui/src/components/settings/providers/Ollama.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { useRouterModels } from "@src/components/ui/hooks/useRouterModels"
1111
import { vscode } from "@src/utils/vscode"
1212

1313
import { inputEventTransform } from "../transforms"
14-
import { ApiKeyField } from "../common/ApiKeyField"
1514

1615
type OllamaProps = {
1716
apiConfiguration: ProviderSettings
@@ -88,13 +87,17 @@ export const Ollama = ({ apiConfiguration, setApiConfigurationField }: OllamaPro
8887
<label className="block font-medium mb-1">{t("settings:providers.ollama.baseUrl")}</label>
8988
</VSCodeTextField>
9089
{apiConfiguration?.ollamaBaseUrl && (
91-
<ApiKeyField
92-
initialValue={apiConfiguration?.ollamaApiKey || ""}
93-
onChange={(value) => setApiConfigurationField("ollamaApiKey", value)}
94-
providerName="Ollama"
95-
placeholder={t("settings:placeholders.apiKey.ollama")}
96-
helpText={t("settings:providers.ollama.apiKeyHelp")}
97-
/>
90+
<VSCodeTextField
91+
value={apiConfiguration?.ollamaApiKey || ""}
92+
type="password"
93+
onInput={handleInputChange("ollamaApiKey")}
94+
placeholder={t("settings:placeholders.apiKey")}
95+
className="w-full">
96+
<label className="block font-medium mb-1">{t("settings:providers.ollama.apiKey")}</label>
97+
<div className="text-xs text-vscode-descriptionForeground mt-1">
98+
{t("settings:providers.ollama.apiKeyHelp")}
99+
</div>
100+
</VSCodeTextField>
98101
)}
99102
<VSCodeTextField
100103
value={apiConfiguration?.ollamaModelId || ""}

0 commit comments

Comments
 (0)