fix: enable Add Header button in OpenAICompatibleProvider (#7246)
* fix: enable Add Header button in OpenAICompatibleProvider Implement functionality for the Add Header button that was previously disabled. The button now: - Enables when headers are not managed by remote configuration - Creates new header entries with auto-incremented keys (header1, header2, etc.) - Updates the API configuration state with the new header This allows users to add custom headers to their OpenAI-compatible provider configuration unless restricted by organization settings. * add changeset
This commit is contained in:
2 files changed
+16
-1
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
fix: enable Add Header button in OpenAICompatibleProvider UI
|
||||
@@ -137,7 +137,17 @@ export const OpenAICompatibleProvider = ({ showModelOptions, isPopup, currentMod
|
||||
This setting is managed by your organization's remote configuration
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
<VSCodeButton disabled={true}>Add Header</VSCodeButton>
|
||||
<VSCodeButton
|
||||
disabled={remoteConfigSettings?.openAiHeaders !== undefined}
|
||||
onClick={() => {
|
||||
const currentHeaders = { ...(apiConfiguration?.openAiHeaders || {}) }
|
||||
const headerCount = Object.keys(currentHeaders).length
|
||||
const newKey = `header${headerCount + 1}`
|
||||
currentHeaders[newKey] = ""
|
||||
handleFieldChange("openAiHeaders", currentHeaders)
|
||||
}}>
|
||||
Add Header
|
||||
</VSCodeButton>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
||||
Reference in new issue
Block a user