feat(proxy): add isFullUrl toggle for full API endpoint mode

- provider.rs/types.ts: add is_full_url field to ProviderMeta
- forwarder.rs: when isFullUrl is set, use base_url directly instead of
  appending endpoint path; also handle query passthrough and strip
  beta=true when transforming to /v1/chat/completions
- EndpointField.tsx: add Link2 icon toggle button for full URL mode
- ClaudeFormFields.tsx: pass through isFullUrl/onFullUrlChange props
- ProviderForm.tsx: manage localIsFullUrl state, persist to meta on save
- useProviderActions.ts: block switching to isFullUrl or openai_chat
  providers when proxy is not running, show warning toast
- App.tsx: pass isProxyRunning to useProviderActions
- i18n: add fullUrlEnabled/fullUrlDisabled/fullUrlHint and
  proxyRequiredForSwitch translations for zh/en/ja
This commit is contained in:
YoVinchen
2026-02-25 22:11:52 +08:00
parent 87b08ce242
commit 6427ab2128
11 changed files with 142 additions and 14 deletions
@@ -76,6 +76,10 @@ interface ClaudeFormFieldsProps {
// Auth Key Field (ANTHROPIC_AUTH_TOKEN vs ANTHROPIC_API_KEY)
apiKeyField: ClaudeApiKeyField;
onApiKeyFieldChange: (field: ClaudeApiKeyField) => void;
// Full URL mode
isFullUrl: boolean;
onFullUrlChange: (value: boolean) => void;
}
export function ClaudeFormFields({
@@ -112,6 +116,8 @@ export function ClaudeFormFields({
onApiFormatChange,
apiKeyField,
onApiKeyFieldChange,
isFullUrl,
onFullUrlChange,
}: ClaudeFormFieldsProps) {
const { t } = useTranslation();
@@ -179,6 +185,9 @@ export function ClaudeFormFields({
: t("providerForm.apiHint")
}
onManageClick={() => onEndpointModalToggle(true)}
showFullUrlToggle={true}
isFullUrl={isFullUrl}
onFullUrlChange={onFullUrlChange}
/>
)}