dsh-plugin-mesh 0.5.1 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,379 @@
1
+ /**
2
+ * osInfo 的自测:纯 fixture,不碰真实系统。
3
+ *
4
+ * 为什么不用真实采集:macOS/Android 的分支在开发机上跑不到;这些平台差异
5
+ * 正是最容易出 bug 的地方(sw_vers 输出、os-release 引号、getprop 换行)。
6
+ */
7
+ import assert from "node:assert/strict";
8
+ import { detectOsInfo, sanitizeOsInfo, detectSystems, sanitizeSystems } from "./osinfo.js";
9
+ import { MeshDiscovery } from "./discovery.js";
10
+
11
+ let passed = 0;
12
+ let failed = 0;
13
+ function check(label, fn) {
14
+ try {
15
+ fn();
16
+ passed += 1;
17
+ console.log(` ✓ ${label}`);
18
+ } catch (err) {
19
+ failed += 1;
20
+ console.log(` ✗ ${label}`);
21
+ console.log(` ${err?.message ?? err}`);
22
+ }
23
+ }
24
+
25
+ console.log("\n── 平台分支:四个系统都要给出可读名字/版本 ──");
26
+
27
+ check("win32:os.version() 是产品名,release 是版本", () => {
28
+ const info = detectOsInfo({
29
+ platform: "win32",
30
+ release: "10.0.26200",
31
+ arch: "x64",
32
+ osVersion: () => "Windows 11 Home China",
33
+ });
34
+ assert.equal(info.platform, "win32");
35
+ assert.equal(info.name, "Windows 11 Home China");
36
+ assert.equal(info.version, "10.0.26200");
37
+ assert.equal(info.kernel, "10.0.26200");
38
+ assert.equal(info.arch, "x64");
39
+ assert.equal(info.distro, "");
40
+ });
41
+
42
+ check("win32:os.version() 拿不到时退回 Windows,不抛", () => {
43
+ const info = detectOsInfo({ platform: "win32", release: "10.0.19045", arch: "x64", osVersion: () => "" });
44
+ assert.equal(info.name, "Windows");
45
+ assert.equal(info.version, "10.0.19045");
46
+ });
47
+
48
+ check("darwin:sw_vers 的 productName/productVersion", () => {
49
+ const info = detectOsInfo({
50
+ platform: "darwin",
51
+ release: "24.1.0",
52
+ arch: "arm64",
53
+ run: (_cmd, args) => (args[0] === "-productName" ? "macOS" : "15.1"),
54
+ });
55
+ assert.equal(info.platform, "darwin");
56
+ assert.equal(info.name, "macOS");
57
+ assert.equal(info.version, "15.1");
58
+ assert.equal(info.kernel, "24.1.0");
59
+ assert.equal(info.arch, "arm64");
60
+ });
61
+
62
+ check("darwin:sw_vers 不可用时仍有 macOS 名字", () => {
63
+ const info = detectOsInfo({
64
+ platform: "darwin",
65
+ release: "24.1.0",
66
+ arch: "arm64",
67
+ run: () => {
68
+ throw new Error("ENOENT");
69
+ },
70
+ });
71
+ assert.equal(info.name, "macOS");
72
+ assert.equal(info.version, "");
73
+ assert.equal(info.kernel, "24.1.0");
74
+ });
75
+
76
+ check("linux:解析 /etc/os-release 的 NAME/VERSION_ID/ID", () => {
77
+ const fixture = [
78
+ 'PRETTY_NAME="Ubuntu 26.04 LTS"',
79
+ 'NAME="Ubuntu"',
80
+ 'VERSION_ID="26.04"',
81
+ "ID=ubuntu",
82
+ "",
83
+ ].join("\n");
84
+ const info = detectOsInfo({
85
+ platform: "linux",
86
+ release: "6.6.114.1-microsoft-standard-WSL2",
87
+ arch: "x64",
88
+ env: { XDG_CURRENT_DESKTOP: "ubuntu:GNOME" },
89
+ readFile: () => fixture,
90
+ });
91
+ assert.equal(info.platform, "linux");
92
+ assert.equal(info.name, "Ubuntu");
93
+ assert.equal(info.version, "26.04");
94
+ assert.equal(info.distro, "ubuntu");
95
+ assert.equal(info.desktop, "GNOME");
96
+ assert.equal(info.kernel, "6.6.114.1-microsoft-standard-WSL2");
97
+ });
98
+
99
+ check("linux:os-release 缺失时退回 Linux,desktop 可为空", () => {
100
+ const info = detectOsInfo({
101
+ platform: "linux",
102
+ release: "6.1.0",
103
+ arch: "x64",
104
+ env: {},
105
+ readFile: () => {
106
+ throw new Error("ENOENT");
107
+ },
108
+ });
109
+ assert.equal(info.name, "Linux");
110
+ assert.equal(info.version, "");
111
+ assert.equal(info.desktop, "");
112
+ });
113
+
114
+ check("android:getprop 的版本号,带换行也能取对", () => {
115
+ const info = detectOsInfo({
116
+ platform: "android",
117
+ release: "5.10.101-android13",
118
+ arch: "arm64",
119
+ run: () => "14\n",
120
+ });
121
+ assert.equal(info.platform, "android");
122
+ assert.equal(info.name, "Android");
123
+ assert.equal(info.version, "14");
124
+ assert.equal(info.arch, "arm64");
125
+ });
126
+
127
+ check("未知平台:给可读名字,platform 留空(UI 走回退徽章)", () => {
128
+ const info = detectOsInfo({ platform: "freebsd", release: "14.0", arch: "x64" });
129
+ assert.equal(info.platform, "");
130
+ assert.equal(info.name, "freebsd");
131
+ assert.equal(info.version, "14.0");
132
+ });
133
+
134
+ console.log("\n── sanitizeOsInfo:对端名片是网络输入 ──");
135
+
136
+ check("platform 白名单:未知值被清空", () => {
137
+ const info = sanitizeOsInfo({ platform: "plan9", name: "Plan 9" });
138
+ assert.equal(info.platform, "");
139
+ assert.equal(info.name, "Plan 9");
140
+ });
141
+
142
+ check("控制字符剥掉、空白折叠、字段截断", () => {
143
+ const info = sanitizeOsInfo({
144
+ platform: "linux",
145
+ name: ` Ubuntu\u0000\t${"x".repeat(80)} `,
146
+ version: "24.04\n",
147
+ kernel: "k".repeat(100),
148
+ desktop: "GNOME",
149
+ arch: "x64",
150
+ });
151
+ assert.ok(!info.name.includes("\u0000"));
152
+ assert.ok(info.name.length <= 48, `name 未截断: ${info.name.length}`);
153
+ assert.equal(info.version, "24.04");
154
+ assert.ok(info.kernel.length <= 64);
155
+ });
156
+
157
+ check("空对象 / 垃圾输入 → null(调用方回退老 os 字段)", () => {
158
+ assert.equal(sanitizeOsInfo(null), null);
159
+ assert.equal(sanitizeOsInfo(undefined), null);
160
+ assert.equal(sanitizeOsInfo("win32"), null);
161
+ assert.equal(sanitizeOsInfo([]), null);
162
+ assert.equal(sanitizeOsInfo({}), null);
163
+ assert.equal(sanitizeOsInfo({ platform: "", name: "" }), null);
164
+ });
165
+
166
+ check("老对端只报 os 字符串:没有 osInfo 时不伪造", () => {
167
+ assert.equal(sanitizeOsInfo(undefined), null);
168
+ });
169
+
170
+ console.log("\n── systems:宿主机 + WSL 发行版(只读注册表,不启动发行版)──");
171
+
172
+ const WSL_REG = [
173
+ "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Lxss",
174
+ " DefaultVersion REG_DWORD 0x2",
175
+ "",
176
+ "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Lxss\\{1111}",
177
+ " State REG_DWORD 0x1",
178
+ " DistributionName REG_SZ Ubuntu",
179
+ " Flavor REG_SZ ubuntu",
180
+ " OsVersion REG_SZ 26.04",
181
+ "",
182
+ "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Lxss\\{2222}",
183
+ " State REG_DWORD 0x1",
184
+ " DistributionName REG_SZ docker-desktop",
185
+ ].join("\n");
186
+
187
+ const winOpts = (run, readFile) => ({
188
+ platform: "win32",
189
+ release: "10.0.26200",
190
+ arch: "x64",
191
+ osVersion: () => "Windows 11 Home China",
192
+ run,
193
+ readFile,
194
+ });
195
+
196
+ check("win32:宿主机 + Ubuntu,docker-desktop 被过滤,且有版本时不该读 UNC", () => {
197
+ const list = detectSystems(
198
+ winOpts(
199
+ () => WSL_REG,
200
+ () => {
201
+ throw new Error("不该在读不到的情况下访问 UNC");
202
+ },
203
+ ),
204
+ );
205
+ assert.equal(list.length, 2);
206
+ assert.equal(list[0].kind, "host");
207
+ assert.equal(list[0].name, "Windows 11 Home China");
208
+ assert.equal(list[1].kind, "wsl");
209
+ assert.equal(list[1].platform, "linux");
210
+ assert.equal(list[1].name, "Ubuntu");
211
+ assert.equal(list[1].version, "26.04");
212
+ assert.equal(list[1].distro, "ubuntu");
213
+ });
214
+
215
+ check("WSL 注册表缺 OsVersion 时,运行中的发行版读 /etc/os-release 补版本", () => {
216
+ const reg = [
217
+ "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Lxss\\{3333}",
218
+ " State REG_DWORD 0x1",
219
+ " DistributionName REG_SZ Debian",
220
+ ].join("\n");
221
+ const list = detectSystems(
222
+ winOpts(
223
+ () => reg,
224
+ (path) => {
225
+ assert.match(path, /Debian/);
226
+ return 'NAME="Debian"\nVERSION_ID="12"\nID=debian\n';
227
+ },
228
+ ),
229
+ );
230
+ assert.equal(list.length, 2);
231
+ assert.equal(list[1].name, "Debian");
232
+ assert.equal(list[1].version, "12");
233
+ assert.equal(list[1].distro, "debian");
234
+ });
235
+
236
+ check("停着的 WSL 发行版不读 UNC(不启动它),版本留空", () => {
237
+ const reg = [
238
+ "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Lxss\\{4444}",
239
+ " State REG_DWORD 0x0",
240
+ " DistributionName REG_SZ openSUSE",
241
+ ].join("\n");
242
+ const list = detectSystems(
243
+ winOpts(
244
+ () => reg,
245
+ () => {
246
+ throw new Error("停着的发行版不该被访问");
247
+ },
248
+ ),
249
+ );
250
+ assert.equal(list.length, 2);
251
+ assert.equal(list[1].name, "openSUSE");
252
+ assert.equal(list[1].version, "");
253
+ });
254
+
255
+ check("没有 WSL 注册表 → 只报宿主机", () => {
256
+ const list = detectSystems(
257
+ winOpts(
258
+ () => {
259
+ throw new Error("ERROR: The system was unable to find the specified registry key");
260
+ },
261
+ () => "",
262
+ ),
263
+ );
264
+ assert.equal(list.length, 1);
265
+ assert.equal(list[0].kind, "host");
266
+ });
267
+
268
+ check("非 win32:不探测 WSL,只报宿主机", () => {
269
+ const list = detectSystems({
270
+ platform: "linux",
271
+ release: "6.1.0",
272
+ arch: "x64",
273
+ env: {},
274
+ readFile: () => 'NAME="Debian"\nVERSION_ID="12"\nID=debian\n',
275
+ run: () => {
276
+ throw new Error("非 Windows 不该跑 reg");
277
+ },
278
+ });
279
+ assert.equal(list.length, 1);
280
+ assert.equal(list[0].kind, "host");
281
+ assert.equal(list[0].name, "Debian");
282
+ });
283
+
284
+ check("sanitizeSystems:去重、kind 白名单、最多 4 项、宿主机排第一", () => {
285
+ const list = sanitizeSystems([
286
+ { kind: "wsl", platform: "linux", name: "Ubuntu", version: "24.04" },
287
+ { kind: "host", platform: "win32", name: "Win", version: "11" },
288
+ { kind: "wsl", platform: "linux", name: "Ubuntu", version: "24.04" },
289
+ { kind: "vm", platform: "linux", name: "Debian", version: "12" },
290
+ { kind: "container", platform: "linux", name: "Alpine", version: "3.20" },
291
+ { kind: "nope", platform: "linux", name: "Other", version: "1" },
292
+ ]);
293
+ assert.equal(list.length, 4);
294
+ assert.equal(list[0].kind, "host");
295
+ assert.equal(list[0].name, "Win");
296
+ assert.ok(!list.some((s) => s.name === "Other"), "第 5 个及以后的系统应被截断");
297
+ });
298
+
299
+ console.log("\n── 名片收发:selfRecord 带 osInfo,对端 osInfo 会被清洗 ──");
300
+
301
+ check("selfRecord 带本机 osInfo", () => {
302
+ const d = new MeshDiscovery({ id: "self-os", port: 0, meta: { machine: "me" } });
303
+ const info = d.selfRecord().osInfo;
304
+ assert.ok(info, "selfRecord 应带 osInfo");
305
+ assert.ok(info.name, "至少要有可读的系统名");
306
+ assert.equal(info.platform, process.platform === "win32" ? "win32" : info.platform);
307
+ const list = d.selfRecord().systems;
308
+ assert.ok(Array.isArray(list) && list.length >= 1, "selfRecord 应带 systems[]");
309
+ assert.equal(list[0].kind, "host");
310
+ });
311
+
312
+ check("对端 osInfo 被保存;旧对端没有该字段时为 null", () => {
313
+ const d = new MeshDiscovery({ id: "self-os", port: 0, meta: { machine: "me" } });
314
+ d.note(
315
+ {
316
+ app: "dsh-mesh",
317
+ id: "peer-mac",
318
+ machine: "mac",
319
+ os: "darwin 24.1.0",
320
+ osInfo: {
321
+ platform: "darwin",
322
+ name: "macOS",
323
+ version: "15.1",
324
+ distro: "",
325
+ kernel: "24.1.0",
326
+ desktop: "",
327
+ arch: "arm64",
328
+ },
329
+ },
330
+ "10.0.0.9",
331
+ );
332
+ assert.equal(d.peers()[0].osInfo.platform, "darwin");
333
+ assert.equal(d.peers()[0].osInfo.version, "15.1");
334
+
335
+ d.note({ app: "dsh-mesh", id: "peer-old", machine: "old", os: "linux 6.1.0" }, "10.0.0.10");
336
+ const old = d.peers().find((p) => p.machine === "old");
337
+ assert.equal(old.osInfo, null, "旧对端不该被伪造出一个 osInfo");
338
+ });
339
+
340
+ check("对端 systems[] 被清洗并保存;宿主机排第一", () => {
341
+ const d = new MeshDiscovery({ id: "self-sys", port: 0, meta: { machine: "me" } });
342
+ d.note(
343
+ {
344
+ app: "dsh-mesh",
345
+ id: "peer-sys",
346
+ machine: "multi",
347
+ systems: [
348
+ { kind: "wsl", platform: "linux", name: "Ubuntu", version: "26.04", distro: "ubuntu" },
349
+ { kind: "host", platform: "win32", name: "Windows 11", version: "10.0.26200", arch: "x64" },
350
+ { kind: "wsl", platform: "linux", name: "Ubuntu", version: "26.04", distro: "ubuntu" },
351
+ ],
352
+ },
353
+ "10.0.0.12",
354
+ );
355
+ const list = d.peers()[0].systems;
356
+ assert.equal(list.length, 2, "重复项应被去掉");
357
+ assert.equal(list[0].kind, "host");
358
+ assert.equal(list[1].kind, "wsl");
359
+ });
360
+
361
+ check("对端送垃圾 osInfo:platform 白名单 + 文本截断", () => {
362
+ const d = new MeshDiscovery({ id: "self-os", port: 0, meta: { machine: "me" } });
363
+ d.note(
364
+ {
365
+ app: "dsh-mesh",
366
+ id: "peer-evil",
367
+ machine: "evil",
368
+ osInfo: { platform: "evil", name: "<script>".repeat(20), version: "x".repeat(100) },
369
+ },
370
+ "10.0.0.11",
371
+ );
372
+ const info = d.peers()[0].osInfo;
373
+ assert.equal(info.platform, "");
374
+ assert.ok(info.name.length <= 48);
375
+ assert.ok(info.version.length <= 48);
376
+ });
377
+
378
+ console.log(`\n结果:${passed} 通过,${failed} 失败`);
379
+ process.exit(failed === 0 ? 0 : 1);
@@ -54,7 +54,7 @@ check("detectTarget 给出当前平台", () => {
54
54
 
55
55
  check("assetName 命名与 sidecar 构建脚本一致", () => {
56
56
  const name = assetName();
57
- assert.match(name, /^dsh-mesh-tsnet-(darwin|windows|linux|android)-(amd64|arm64)\.gz$/);
57
+ assert.match(name, /^dsh-mesh-tsnet-(darwin|windows|linux|android)-(amd64|arm64)(\.exe)?\.gz$/);
58
58
  });
59
59
 
60
60
  check("下载源:镜像在前、直连 GitHub 兜底", () => {
@@ -553,6 +553,17 @@ check("note() 显式传端口时以显式为准(tailnet / 扫描路径)", ()
553
553
  assert.equal(d.peers()[0].endpoints.find((e) => e.transport === "tsnet").port, 46150);
554
554
  });
555
555
 
556
+ check("note() 以观察到的地址为准,自述 host 不能改派发目标", () => {
557
+ const d = new MeshDiscovery({ id: "self-1", port: 45917, meta: { machine: "me" } });
558
+ d.note(
559
+ { app: "dsh-mesh", id: "spoof", machine: "peer", host: "attacker.example.com", port: 8080 },
560
+ "10.1.2.3",
561
+ );
562
+ const p = d.peers()[0];
563
+ assert.equal(p.host, "10.1.2.3", "LAN 也必须用观察到的地址");
564
+ assert.equal(p.endpoints[0].host, "10.1.2.3");
565
+ });
566
+
556
567
  check("endpointAlive:存活窗口跟随探测间隔(慢节奏通道不被 TTL 判死)", () => {
557
568
  const now = 1_000_000;
558
569
  // tailnet 通道每 60s 才探一次,而默认 TTL 是 20s ——
@@ -565,6 +576,20 @@ check("endpointAlive:存活窗口跟随探测间隔(慢节奏通道不被 TT
565
576
  assert.equal(endpointAlive(fast, now, 20_000), false, "10s 节奏的通道 50s 没消息就该判死");
566
577
  });
567
578
 
579
+ check("心跳不清零出站失败冷却(单向可达时不再永远先打 LAN)", () => {
580
+ const d = new MeshDiscovery({ id: "self-1", port: 45917, meta: { machine: "me" } });
581
+ const rec = { app: "dsh-mesh", id: "dev", machine: "hos", host: "10.0.0.9", port: 45917 };
582
+ d.note(rec, "10.0.0.9");
583
+ d.markEndpoint("dev", "lan", { ok: false });
584
+ d.markEndpoint("dev", "lan", { ok: false });
585
+ const before = d.peers()[0].endpoints.find((e) => e.transport === "lan");
586
+ assert.ok(before.downUntil > Date.now(), "连续失败后应进入冷却");
587
+ d.note(rec, "10.0.0.9");
588
+ const after = d.peers()[0].endpoints.find((e) => e.transport === "lan");
589
+ assert.equal(after.failCount, 2, "心跳不该清零 failCount");
590
+ assert.equal(after.downUntil, before.downUntil, "心跳不该清掉冷却截止时间");
591
+ });
592
+
568
593
  check("全部端点冷却时:投影为空,但 orderedEndpoints 仍要给出发送目标", () => {
569
594
  const d = new MeshDiscovery({ id: "self-1", port: 45917, meta: { machine: "me" } });
570
595
  d.note(
@@ -123,6 +123,7 @@ const {
123
123
  TaskRow,
124
124
  TaskDetail,
125
125
  SettingsView,
126
+ Diagnostics,
126
127
  Composer,
127
128
  DispatchPanel,
128
129
  DeviceList,
@@ -419,6 +420,22 @@ test("任务页左栏只写条数,不重复「任务」", () => {
419
420
  assert.notEqual(titles[0], "任务");
420
421
  });
421
422
 
423
+ test("诊断卡显示「进程版本 / 磁盘版本」,漂移时说清要重启", () => {
424
+ const drift = {
425
+ self: { version: "0.5.2", diskVersion: "0.5.3", versionDrift: true, port: 45917 },
426
+ config: {},
427
+ peers: [],
428
+ };
429
+ const txt = textOf(Diagnostics({ state: drift, push: noop })).join(" ");
430
+ assert.ok(txt.includes("版本(进程)"), txt);
431
+ assert.ok(txt.includes("版本(磁盘)"), txt);
432
+ assert.ok(txt.includes("重启 DSH 后新版本才生效"), txt);
433
+
434
+ // 没漂移时不该吓人
435
+ const same = { self: { version: "0.5.2", diskVersion: "0.5.2", versionDrift: false }, config: {}, peers: [] };
436
+ assert.ok(!textOf(Diagnostics({ state: same, push: noop })).join(" ").includes("重启 DSH"));
437
+ });
438
+
422
439
  test("连接页不再重复写「连接」大标题", () => {
423
440
  const el = SettingsView({ state, open: null, onOpen: noop, onSaveName: async () => true, nameBusy: false, push: noop, reload: async () => {} });
424
441
  let h1 = 0;
@@ -428,6 +445,42 @@ test("连接页不再重复写「连接」大标题", () => {
428
445
  assert.equal(h1, 0, "tab 已经叫「连接」,正文不必再来一个 h1");
429
446
  });
430
447
 
448
+ console.log("\n── 系统身份(osInfo / systems / WSL)──");
449
+
450
+ const winPeer = {
451
+ ...peer,
452
+ os: "win32 10.0.22631",
453
+ osInfo: { platform: "win32", name: "Windows 11 Home China", version: "10.0.22631", distro: "", kernel: "10.0.22631", desktop: "", arch: "x64" },
454
+ systems: [
455
+ { kind: "host", platform: "win32", name: "Windows 11 Home China", version: "10.0.22631" },
456
+ { kind: "wsl", platform: "linux", name: "Ubuntu", version: "22.04", distro: "ubuntu" },
457
+ ],
458
+ capabilities: { ...peer.capabilities, wsl: [{ name: "Ubuntu", runtimes: { node: "22.1", python: "3.12" }, error: "" }] },
459
+ };
460
+
461
+ test("设备详情用结构化 osInfo(不再是 win32 10.0.xxx 这种机器串)", () => {
462
+ const txt = textOf(DeviceDetail({ peer: winPeer, now, onCompose: noop, onProbe: noop, onBack: noop })).join(" ");
463
+ assert.ok(txt.includes("Windows 11 Home China"), txt);
464
+ });
465
+
466
+ test("同一台机器上的 WSL 单独标出来,不混进宿主机", () => {
467
+ const txt = textOf(DeviceDetail({ peer: winPeer, now, onCompose: noop, onProbe: noop, onBack: noop })).join(" ");
468
+ assert.ok(txt.includes("WSL Ubuntu 22.04"), `应显示 WSL 发行版:${txt}`);
469
+ });
470
+
471
+ test("老对端(只有 os 字符串)不能崩,回退到 osLabel", () => {
472
+ const legacy = { ...peer, os: "linux 6.1", osInfo: null, systems: null, capabilities: { runtimes: {} } };
473
+ const txt = textOf(DeviceDetail({ peer: legacy, now, onCompose: noop, onProbe: noop, onBack: noop })).join(" ");
474
+ assert.ok(txt.includes("Linux"), txt);
475
+ });
476
+
477
+ test("能力 chip 里 WSL 运行时单独一行(Windows 的 Python ≠ WSL 的 Python)", () => {
478
+ const txt = textOf(CapabilityChips({ caps: winPeer.capabilities, peer: winPeer })).join(" ");
479
+ assert.ok(txt.includes("WSL"), txt);
480
+ assert.ok(txt.includes("Ubuntu"), txt);
481
+ assert.ok(txt.includes("node 22.1"), txt);
482
+ });
483
+
431
484
  console.log("\n── 图标:网段探测 vs 单机探测 ──");
432
485
 
433
486
  /** 收集组件树里所有按钮/图标按钮的 icon 名(含函数组件展开)。 */