Expose the online-list TLS column through list_online_hosts, search_hosts and get_host_detail. The value comes from the flag the client reports at login, so old clients always read false. Add list_network_connections and kill_network_connection on top of the connection manager sub-connection protocol. The kill path matches the original 110-byte record instead of rebuilding addresses, supports a dry run, refuses UDP/IPv6 targets, and verifies that the quadruple really disappeared instead of assuming success. Add a host_* family backed by the machine manager protocol: ten read tools covering every tab of the host management dialog, and four recoverable write tools for process freeze/thaw, window restore/hide/ maximize/minimize, service start/stop/pause/continue/restart, and scheduled task run/stop. Every write re-reads the snapshot before sending and re-checks afterwards, reporting -32009 for stale targets rather than acting blindly. The family is gated by McpMachine, the risky subset by McpMachineDangerous, and writes additionally require read-only mode to be off. Route managed sub-connections from MessageHandle and OfflineProc, keep the single-in-flight rule by sharing the pending table with a request kind, and move the shared JSON/lock/encoding helpers into McpInternal so both tool families use one implementation. Settings dialog, design docs and en_US/zh_TW/de_DE translations are updated accordingly. Co-Authored-By: deepseek-flash
57 lines
2.2 KiB
C++
57 lines
2.2 KiB
C++
#pragma once
|
||
|
||
#include <afxwin.h>
|
||
#include <afxcmn.h>
|
||
#include <vector>
|
||
|
||
// 「MCP设置」配置对话框:启用 MCP / 端口 / 绑定地址 / Token。
|
||
// 因 2015Remote.rc 为 UTF-16 编码、不宜手工编辑,参照 ZstaPickerDlg 用
|
||
// InitModalIndirect + 内存 DLGTEMPLATE 程序化创建(见 docs/Mcp_Design.md §3.8)。
|
||
class CMcpSettingsDlg : public CDialog
|
||
{
|
||
public:
|
||
explicit CMcpSettingsDlg(CWnd* parent = nullptr);
|
||
|
||
virtual INT_PTR DoModal();
|
||
|
||
protected:
|
||
virtual BOOL OnInitDialog();
|
||
virtual void OnOK();
|
||
|
||
DECLARE_MESSAGE_MAP()
|
||
|
||
private:
|
||
enum CtrlId {
|
||
IDC_MCP_ENABLE = 1001, // 「启用 MCP」复选框
|
||
IDC_MCP_PORT = 1002, // 端口编辑框
|
||
IDC_MCP_BIND = 1003, // 绑定地址编辑框
|
||
IDC_MCP_TOKEN = 1004, // Token 编辑框
|
||
IDC_MCP_READONLY = 1005, // 「只读模式」复选框(默认勾选,禁 exec_command)
|
||
IDC_MCP_WHITELIST = 1006, // 命令白名单编辑框(多行,逗号/换行分隔,空 = 内置只读前缀)
|
||
IDC_MCP_TERMINAL = 1007, // 「启用持久终端」复选框(全命令,无白名单,要求只读关)
|
||
IDC_MCP_REMOTECONTROL = 1008, // 「启用远程控制」复选框(AI 操控桌面,要求只读关)
|
||
IDC_MCP_FILETRANSFER = 1009, // 「启用文件传输」复选框(download_file,不要求只读关)
|
||
IDC_MCP_MANAGE = 1010, // 「启用管理操作」复选框(kill/窗口/服务/电源,要求只读关)
|
||
IDC_MCP_MACHINE = 1011, // 「启用主机管理」复选框(host_* 工具族)
|
||
IDC_MCP_MACHINE_DANGEROUS = 1012, // 「启用危险主机操作」复选框(冻结/停止/重启)
|
||
};
|
||
|
||
CButton m_btnEnable;
|
||
CStatic m_lblPort, m_lblBind, m_lblToken;
|
||
CEdit m_editPort, m_editBind, m_editToken;
|
||
CButton m_btnReadonly;
|
||
CButton m_btnTerminal;
|
||
CButton m_btnRemoteControl;
|
||
CButton m_btnFileTransfer;
|
||
CButton m_btnManage;
|
||
CButton m_btnMachine;
|
||
CButton m_btnMachineDangerous;
|
||
CStatic m_lblWhitelist;
|
||
CEdit m_editWhitelist;
|
||
CButton m_btnOK, m_btnCancel;
|
||
|
||
std::vector<BYTE> m_Template; // 内存 DLGTEMPLATE 字节
|
||
|
||
void LayoutControls(int cx, int cy);
|
||
};
|