MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / handleSaveDynamicProxy

Function handleSaveDynamicProxy

static/js/settings.js:1262–1278  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

1260// ============== 动态代理设置 ==============
1261
1262async function handleSaveDynamicProxy(e) {
1263 e.preventDefault();
1264 const data = {
1265 enabled: document.getElementById('dynamic-proxy-enabled').checked,
1266 api_url: document.getElementById('dynamic-proxy-api-url').value.trim(),
1267 api_key: document.getElementById('dynamic-proxy-api-key').value || null,
1268 api_key_header: document.getElementById('dynamic-proxy-api-key-header').value.trim() || 'X-API-Key',
1269 result_field: document.getElementById('dynamic-proxy-result-field').value.trim()
1270 };
1271 try {
1272 await api.post('/settings/proxy/dynamic', data);
1273 toast.success('动态代理设置已保存');
1274 document.getElementById('dynamic-proxy-api-key').value = '';
1275 } catch (error) {
1276 toast.error('保存失败: ' + error.message);
1277 }
1278}
1279
1280async function handleTestDynamicProxy() {
1281 const apiUrl = document.getElementById('dynamic-proxy-api-url').value.trim();

Callers

nothing calls this directly

Calls 3

successMethod · 0.80
errorMethod · 0.80
postMethod · 0.45

Tested by

no test coverage detected