- {/* Description */}
-
- Configure local or remote CLIProxyAPI connection for proxy-based profiles
-
-
- {/* Mode Toggle - Card based selection */}
-
-
Connection Mode
-
- {/* Local Mode Card */}
-
-
- {/* Remote Mode Card */}
-
-
-
-
- {/* Remote Settings - Show when remote mode is enabled */}
- {isRemoteMode && (
-
-
-
- Remote Server Configuration
-
-
- {/* Host */}
-
-
- setEditedHost(e.target.value)}
- onBlur={saveHost}
- placeholder="192.168.1.100 or proxy.example.com"
- className="font-mono"
- disabled={saving}
- />
-
-
- {/* Port and Protocol */}
-
-
-
- setEditedPort(e.target.value.replace(/\D/g, ''))}
- onBlur={savePort}
- placeholder={`Leave empty for ${getDefaultPort(config?.remote.protocol || 'http')}`}
- className="font-mono"
- disabled={saving}
- />
-
-
-
-
-
-
-
- {/* Auth Token */}
-
-
- setEditedAuthToken(e.target.value)}
- onBlur={saveAuthToken}
- placeholder="Bearer token for authentication"
- className="font-mono"
- disabled={saving}
- />
-
-
- {/* Test Connection */}
-
-
-
- {/* Test Result */}
- {testResult && (
-
-
- {testResult.reachable ? (
- <>
-
-
- Connected ({testResult.latencyMs}ms)
-
- >
- ) : (
- <>
-
-
- {testResult.error || 'Connection failed'}
-
- >
- )}
-
-
- )}
-
-
- )}
-
- {/* Fallback Settings */}
-
-
Fallback Settings
-
- {/* Enable Fallback */}
-
-
-
Enable fallback to local
-
- Use local proxy if remote is unreachable
-
-
-
- saveCliproxyServerConfig({ fallback: { ...fallbackConfig, enabled: checked } })
- }
- disabled={saving || !isRemoteMode}
- />
-
-
- {/* Auto-start on fallback */}
-
-
-
Auto-start local proxy
-
- Automatically start local proxy on fallback
-
-
-
- saveCliproxyServerConfig({
- fallback: { ...fallbackConfig, auto_start: checked },
- })
- }
- disabled={saving || !isRemoteMode || !config?.fallback.enabled}
- />
-
-
-
-
- {/* Local Proxy Settings - Only show in Local mode */}
- {!isRemoteMode && (
-
-
Local Proxy
-
- {/* Port */}
-
-
- setEditedLocalPort(e.target.value)}
- onBlur={saveLocalPort}
- placeholder="8317"
- className="font-mono max-w-32"
- disabled={saving}
- />
-
-
- {/* Auto-start */}
-
-
-
Auto-start
-
- Start local proxy automatically when needed
-
-
-
- saveCliproxyServerConfig({ local: { ...localConfig, auto_start: checked } })
- }
- disabled={saving}
- />
-
-
-
- )}
-
-