Feature: add MCP settings presets and hide command whitelist
The MCP settings dialog had grown too many independent tool switches to tick by hand. Add two one-click preset buttons next to the "Enable MCP" checkbox. "Read-only mode" turns MCP on, enables the read-only switch, and unchecks every feature that only works when read-only is off (persistent terminal, remote control, file write, management, dangerous host operations, client build). "Smart mode" turns MCP on, disables read-only, and enables all tool switches, including host management plus dangerous host operations so the OnOK dependency check does not revert it. Stop showing the command whitelist input: it is advanced and is easily bypassed once the persistent terminal is enabled. Its load, normalize and save logic is left untouched, so the persisted McpCmdWhitelist still round-trips unchanged and the server-side whitelist check is unchanged. Add translations for the two new button labels (en_US, zh_TW, de_DE), and size the preset buttons from the current font so translated labels do not clip. Verified with a Debug x64 server build; the dialog was not clicked through. Co-Authored-By: deepseek-flash
This commit is contained in:
1 parent
545700abaa
commit
5387603c73
5 files changed
+94
-9
No files matched your search
@@ -21,6 +21,8 @@ protected:
|
||||
afx_msg void OnHttpsToggle();
|
||||
afx_msg void OnBrowseCert();
|
||||
afx_msg void OnBrowseKey();
|
||||
afx_msg void OnPresetReadonly(); // 「只读模式」预设:勾选只读并关闭依赖只读关闭的开关
|
||||
afx_msg void OnPresetSmart(); // 「智能模式」预设:启用全部工具并关闭只读
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
@@ -47,9 +49,12 @@ private:
|
||||
IDC_MCP_KEY_BROWSE = 1019, // 私钥路径「浏览」按钮
|
||||
IDC_MCP_FILEWRITE = 1020, // 「启用文件写入」复选框(删除/改名/建目录,要求只读关)
|
||||
IDC_MCP_BUILD = 1021, // 「启用客户端生成」复选框(build_client,要求只读关)
|
||||
IDC_MCP_PRESET_READONLY = 1022, // 「只读模式」预设按钮
|
||||
IDC_MCP_PRESET_SMART = 1023, // 「智能模式」预设按钮
|
||||
};
|
||||
|
||||
CButton m_btnEnable;
|
||||
CButton m_btnPresetReadonly, m_btnPresetSmart; // 「启用 MCP」右侧的一键预设
|
||||
CStatic m_lblPort, m_lblBind, m_lblToken;
|
||||
CEdit m_editPort, m_editBind, m_editToken;
|
||||
CButton m_btnReadonly;
|
||||
|
||||
Reference in new issue
Block a user