feat: 设置面板添加代理配置 — web_search/web_fetch走HTTP代理(Clash等)

This commit is contained in:
thzxx
2026-06-10 15:38:56 +08:00
parent 3c54f15218
commit 3f11e7c3cd
6 changed files with 50 additions and 1 deletions
+12
View File
@@ -39,6 +39,18 @@ export function initSettingsModal(): void {
}, 500);
document.querySelector('#inputServerUrl')!.addEventListener('input', saveServerUrl);
// 代理设置
const inputProxyUrl = document.querySelector('#inputProxyUrl') as HTMLInputElement;
if (inputProxyUrl) {
const saveProxyUrl = debounce(async () => {
const db = state.get<ChatDB | null>(KEYS.DB);
const url = inputProxyUrl.value.trim();
if (db) await db.saveSetting('proxyUrl', url);
logSetting('代理', url || '已禁用');
}, 500);
inputProxyUrl.addEventListener('input', saveProxyUrl);
}
const tempSlider = document.querySelector('#inputTemperature') as HTMLInputElement;
const tempDisplay = document.querySelector('#tempValue')!;
tempSlider.addEventListener('input', () => {