()
| 2729 | } |
| 2730 | |
| 2731 | function populateConfigForm() { |
| 2732 | const c = AppState.currentConfig; |
| 2733 | |
| 2734 | setConfigField('host', c.host || '0.0.0.0'); |
| 2735 | setConfigField('port', c.port || 7861); |
| 2736 | setConfigField('configApiPassword', c.api_password || ''); |
| 2737 | setConfigField('configPanelPassword', c.panel_password || ''); |
| 2738 | setConfigField('configPassword', c.password || 'pwd'); |
| 2739 | setConfigField('credentialsDir', c.credentials_dir || ''); |
| 2740 | setConfigField('proxy', c.proxy || ''); |
| 2741 | setConfigField('codeAssistEndpoint', c.code_assist_endpoint || ''); |
| 2742 | setConfigField('oauthProxyUrl', c.oauth_proxy_url || ''); |
| 2743 | setConfigField('googleapisProxyUrl', c.googleapis_proxy_url || ''); |
| 2744 | setConfigField('resourceManagerApiUrl', c.resource_manager_api_url || ''); |
| 2745 | setConfigField('serviceUsageApiUrl', c.service_usage_api_url || ''); |
| 2746 | setConfigField('antigravityApiUrl', c.antigravity_api_url || ''); |
| 2747 | |
| 2748 | document.getElementById('autoBanEnabled').checked = Boolean(c.auto_ban_enabled); |
| 2749 | setConfigField('autoBanErrorCodes', (c.auto_ban_error_codes || []).join(',')); |
| 2750 | setConfigField('callsPerRotation', c.calls_per_rotation || 10); |
| 2751 | |
| 2752 | document.getElementById('retry429Enabled').checked = Boolean(c.retry_429_enabled); |
| 2753 | setConfigField('retry429MaxRetries', c.retry_429_max_retries || 20); |
| 2754 | setConfigField('retry429Interval', c.retry_429_interval || 0.1); |
| 2755 | |
| 2756 | document.getElementById('compatibilityModeEnabled').checked = Boolean(c.compatibility_mode_enabled); |
| 2757 | document.getElementById('returnThoughtsToFrontend').checked = Boolean(c.return_thoughts_to_frontend !== false); |
| 2758 | document.getElementById('antigravityStream2nostream').checked = Boolean(c.antigravity_stream2nostream !== false); |
| 2759 | document.getElementById('antigravitySwitchCredentialEnabled').checked = Boolean(c.antigravity_switch_credential_enabled); |
| 2760 | |
| 2761 | setConfigField('antiTruncationMaxAttempts', c.anti_truncation_max_attempts || 3); |
| 2762 | |
| 2763 | setConfigField('keepaliveUrl', c.keepalive_url || ''); |
| 2764 | setConfigField('keepaliveInterval', c.keepalive_interval || 60); |
| 2765 | } |
| 2766 | |
| 2767 | function setConfigField(fieldId, value) { |
| 2768 | const field = document.getElementById(fieldId); |
no test coverage detected