dsh-mesh-ui 0.0.2 → 0.0.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.
package/lib/client.js CHANGED
@@ -1249,6 +1249,11 @@ function deviceLinkState(data, peer, lanMap) {
1249
1249
  var localTunnelAll = tunnelNames
1250
1250
  var memText = hw.memTotalGB ? ((hw.memFreeGB != null ? hw.memFreeGB : '?') + ' / ' + hw.memTotalGB + ' GB') : '—'
1251
1251
  var cpuText = hw.cpuModel ? hw.cpuModel + ' · ' + (hw.cpuCores || '?') + ' 线程' : '—'
1252
+ function diskText(d) {
1253
+ if (!d || d.totalGB == null) return '—'
1254
+ var p = String(d.path || '').replace(/[\\/]+$/, '')
1255
+ return (d.freeGB != null ? d.freeGB : '?') + ' / ' + d.totalGB + ' GB' + (p ? ' (' + p + ')' : '')
1256
+ }
1252
1257
 
1253
1258
  var devices = [{
1254
1259
  key: 'local',
@@ -1258,6 +1263,7 @@ function deviceLinkState(data, peer, lanMap) {
1258
1263
  ['操作系统', hw.os || '—'],
1259
1264
  ['CPU', cpuText],
1260
1265
  ['内存', memText],
1266
+ ['磁盘', diskText(hw.disk)],
1261
1267
  ['DSH 实例', localUp + '/' + instances.length + ' 在线'],
1262
1268
  ['会话 / 运行', sessions + ' / ' + running],
1263
1269
  ['模型', model],
@@ -1267,12 +1273,16 @@ function deviceLinkState(data, peer, lanMap) {
1267
1273
  ]
1268
1274
  }].concat(peers.map(function (peer) {
1269
1275
  var t = peer.tunnel || {}
1276
+ var hwp = peer.hardware || {}
1270
1277
  return {
1271
1278
  key: 'peer:' + peer.name,
1272
1279
  name: nodeDisplay(peerDeviceKey(peer.name)),
1273
1280
  up: Boolean(peer.up),
1274
1281
  rows: [
1275
- ['操作系统', peer.os || '—'],
1282
+ ['操作系统', hwp.os || peer.os || '—'],
1283
+ ['CPU', hwp.cpuModel ? hwp.cpuModel + ' · ' + (hwp.cpuCores || '?') + ' 线程' : '—'],
1284
+ ['内存', hwp.memTotalGB ? ((hwp.memFreeGB != null ? hwp.memFreeGB : '?') + ' / ' + hwp.memTotalGB + ' GB') : '—'],
1285
+ ['磁盘', diskText(hwp.disk)],
1276
1286
  ['运行时长', uptimeText(peer.uptimeSec)],
1277
1287
  ['DSH 实例', (peer.instancesCount || 0) + ' 个(' + ((peer.instancesList || []).map(function (x) { return x.port + (x.up ? '✓' : '✗') }).join(' ') || '—') + ')'],
1278
1288
  ['会话 / 运行', (peer.sessions || 0) + ' / ' + (peer.running || 0)],
package/lib/collect.js CHANGED
@@ -446,7 +446,8 @@ export async function collect(repo) {
446
446
  instancesList: remoteByNode[peer.name] || [],
447
447
  sessions: stats.sessions,
448
448
  running: stats.running,
449
- hostname: self?.node?.hostname || '',
449
+ hostname: self?.node?.hostname || '',
450
+ hardware: self?.hardware || null,
450
451
  release: self?.node?.release || '',
451
452
  os: osLabel(self?.node?.platform, self?.node?.release),
452
453
  uptimeSec: overviewByNode[peer.name]?.uptimeSec ?? null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-mesh-ui",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "DSH settings-page panel for dsh-mesh: AI network topology, peer health, and delegation panel. Read-only; data is collected from the local mesh CLI.",
5
5
  "icon": "icon.svg",
6
6
  "type": "module",