|
1 | 1 | import { useCallback, useState } from "react" |
| 2 | +import { Checkbox } from "vscrui" |
2 | 3 | import { VSCodeTextField } from "@vscode/webview-ui-toolkit/react" |
3 | 4 |
|
4 | 5 | import { type ProviderSettings, type OrganizationAllowList, requestyDefaultModelId } from "@roo-code/types" |
@@ -34,6 +35,7 @@ export const Requesty = ({ |
34 | 35 | const { t } = useAppTranslation() |
35 | 36 |
|
36 | 37 | const [didRefetch, setDidRefetch] = useState<boolean>() |
| 38 | + const [requestyBaseUrlSelected, setRequestyBaseUrlSelected] = useState(!!apiConfiguration?.requestyBaseUrl) |
37 | 39 |
|
38 | 40 | const handleInputChange = useCallback( |
39 | 41 | <K extends keyof ProviderSettings, E>( |
@@ -72,6 +74,28 @@ export const Requesty = ({ |
72 | 74 | {t("settings:providers.getRequestyApiKey")} |
73 | 75 | </VSCodeButtonLink> |
74 | 76 | )} |
| 77 | + <div> |
| 78 | + <Checkbox |
| 79 | + checked={requestyBaseUrlSelected} |
| 80 | + onChange={(checked: boolean) => { |
| 81 | + setRequestyBaseUrlSelected(checked) |
| 82 | + |
| 83 | + if (!checked) { |
| 84 | + setApiConfigurationField("requestyBaseUrl", "") |
| 85 | + } |
| 86 | + }}> |
| 87 | + {t("settings:providers.useCustomBaseUrl")} |
| 88 | + </Checkbox> |
| 89 | + {requestyBaseUrlSelected && ( |
| 90 | + <VSCodeTextField |
| 91 | + value={apiConfiguration?.requestyBaseUrl || ""} |
| 92 | + type="url" |
| 93 | + onInput={handleInputChange("requestyBaseUrl")} |
| 94 | + placeholder="Default: https://router.requesty.ai/v1" |
| 95 | + className="w-full mt-1" |
| 96 | + /> |
| 97 | + )} |
| 98 | + </div> |
75 | 99 | <Button |
76 | 100 | variant="outline" |
77 | 101 | onClick={() => { |
|
0 commit comments