feat: 添加后端服务地址自定义配置功能

- 在设置面板添加后端服务地址配置项
   - 支持保存、加载和重置自定义配置
   - 配置持久化存储,重启后保留
   - 添加 SSE 请求日志用于验证配置
This commit is contained in:
Roe-xin
2026-03-09 15:29:56 +08:00
parent ad0f0336d5
commit 4ed998e937
8 changed files with 125 additions and 100 deletions

View File

@ -18,6 +18,7 @@ import {
startChangeSession,
handleOpenFileDiff,
} from "../utils/messageHandler";
import { setCustomConfig } from "../config/settings";
import { compactDialog } from "../services/apiClient";
import { VCDViewerPanel } from "./VCDViewerPanel";
import { ChatHistoryManager } from "../utils/chatHistoryManager";
@ -684,6 +685,21 @@ export async function showICHelperPanel(
// 退出登录(前端已有确认对话框)
vscode.commands.executeCommand("ic-coder.logout");
break;
case "saveGeneralSettings":
// 保存通用设置
context.globalState.update('generalSettings', message.settings);
// 更新运行时配置(包括清空)
setCustomConfig({ backendUrl: message.settings.backendUrl || '' });
vscode.window.showInformationMessage('设置已保存');
break;
case "loadGeneralSettings":
// 加载通用设置
const settings = context.globalState.get('generalSettings');
panel.webview.postMessage({
command: 'loadedGeneralSettings',
settings: settings
});
break;
}
},
undefined,