@abtnode/core 1.17.7-beta-20251227-001958-ea2ba3f5 → 1.17.7-beta-20251229-223813-e1e6c5e3

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.
Files changed (39) hide show
  1. package/lib/blocklet/manager/disk.js +74 -32
  2. package/lib/blocklet/manager/ensure-blocklet-running.js +1 -1
  3. package/lib/blocklet/manager/helper/blue-green-start-blocklet.js +1 -1
  4. package/lib/blocklet/manager/helper/install-application-from-general.js +2 -3
  5. package/lib/blocklet/manager/helper/install-component-from-url.js +7 -4
  6. package/lib/blocklet/migration-dist/migration.cjs +5 -4
  7. package/lib/blocklet/passport/index.js +10 -3
  8. package/lib/blocklet/project/index.js +7 -2
  9. package/lib/blocklet/security/index.js +2 -2
  10. package/lib/cert.js +6 -3
  11. package/lib/event/index.js +98 -87
  12. package/lib/event/util.js +7 -13
  13. package/lib/index.js +15 -26
  14. package/lib/migrations/1.5.0-site.js +3 -7
  15. package/lib/migrations/1.5.15-site.js +3 -7
  16. package/lib/monitor/blocklet-runtime-monitor.js +37 -5
  17. package/lib/monitor/node-runtime-monitor.js +4 -4
  18. package/lib/router/helper.js +525 -452
  19. package/lib/router/index.js +280 -104
  20. package/lib/router/manager.js +14 -28
  21. package/lib/states/blocklet-child.js +93 -1
  22. package/lib/states/blocklet-extras.js +1 -1
  23. package/lib/states/blocklet.js +429 -197
  24. package/lib/states/node.js +0 -10
  25. package/lib/states/site.js +87 -4
  26. package/lib/team/manager.js +2 -21
  27. package/lib/util/blocklet.js +39 -19
  28. package/lib/util/get-accessible-external-node-ip.js +21 -6
  29. package/lib/util/index.js +3 -3
  30. package/lib/util/ip.js +15 -1
  31. package/lib/util/launcher.js +11 -11
  32. package/lib/util/ready.js +2 -9
  33. package/lib/util/reset-node.js +6 -5
  34. package/lib/validators/router.js +0 -3
  35. package/lib/webhook/sender/api/index.js +5 -0
  36. package/package.json +23 -25
  37. package/lib/migrations/1.0.36-snapshot.js +0 -10
  38. package/lib/migrations/1.1.9-snapshot.js +0 -7
  39. package/lib/states/routing-snapshot.js +0 -146
@@ -169,14 +169,14 @@ class NodeRuntimeMonitor extends EventEmitter {
169
169
  try {
170
170
  const { cpu, mem, disks } = this.data.realtime;
171
171
  // 计算每个 CPU 的占用率:load字段为百分比,除以 100 得到 0 到 1 的值
172
- const cpuUtilizations = cpu.cpus.filter((v) => v.load > 0).map((v) => v.load / 100);
172
+ const cpuUtilizations = cpu.cpus?.filter((v) => v.load > 0).map((v) => v.load / 100) || [0];
173
+
174
+ // 计算每个硬盘占用率:used / total
175
+ const diskUtilizations = disks?.filter((v) => v.used > 0).map((v) => v.used / v.total) || [0];
173
176
 
174
177
  // 计算内存占用率:used / total
175
178
  const memoryUtilization = mem.total > 0 && mem.available > 0 ? (mem.total - mem.available) / mem.total : 0;
176
179
 
177
- // 计算每个硬盘占用率:used / total
178
- const diskUtilizations = disks.filter((v) => v.used > 0).map((v) => v.used / v.total);
179
-
180
180
  // 返回包含所需值的对象
181
181
  return {
182
182
  cpus: cpuUtilizations,