mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix: improve Azure URL detection and add API version validation
- Improve Azure URL detection logic to be more specific - Add visual validation for manually entered Azure API versions in UI - Import isValidAzureApiVersion function for input validation - Add border color styling to indicate valid/invalid API version format
This commit is contained in:
parent
cc7e5949b5
commit
6b691fb5ca
1 changed files with 16 additions and 1 deletions
|
|
@ -12,7 +12,11 @@ import {
|
|||
openAiModelInfoSaneDefaults,
|
||||
} from "@roo-code/types"
|
||||
|
||||
import { extractApiVersionFromUrl, isAzureOpenAiUrl } from "../../../../../src/utils/azure-url-parser"
|
||||
import {
|
||||
extractApiVersionFromUrl,
|
||||
isAzureOpenAiUrl,
|
||||
isValidAzureApiVersion,
|
||||
} from "../../../../../src/utils/azure-url-parser"
|
||||
|
||||
import { ExtensionMessage } from "@roo/ExtensionMessage"
|
||||
|
||||
|
|
@ -216,6 +220,17 @@ export const OpenAICompatible = ({
|
|||
onInput={handleInputChange("azureApiVersion")}
|
||||
placeholder={`Default: ${azureOpenAiDefaultApiVersion}`}
|
||||
className="w-full mt-1"
|
||||
style={{
|
||||
borderColor: (() => {
|
||||
const value = apiConfiguration?.azureApiVersion
|
||||
if (!value) {
|
||||
return "var(--vscode-input-border)"
|
||||
}
|
||||
return isValidAzureApiVersion(value)
|
||||
? "var(--vscode-charts-green)"
|
||||
: "var(--vscode-errorForeground)"
|
||||
})(),
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue