feat: report local network types

This commit is contained in:
stswangzhiping
2026-04-26 17:29:58 +08:00
parent f6aad310a8
commit a1c9cc9657
2 changed files with 50 additions and 17 deletions

View File

@@ -11,7 +11,7 @@ const { collect } = require('./metrics');
const { getDashboardInfo, resolveOpenclawConfigFile, startTtyd, FrpcManager } = require('./frpc'); // getDashboardInfo 也用于心跳中定期刷新
const { ProvisionManager } = require('./provisioning');
const { BtMonitor } = require('./bt-monitor');
const { hasInternet, hasWiredInternetProbe, getLocalIps } = require('./network');
const { hasInternet, hasWiredInternetProbe, getLocalIps, getLocalNetworks } = require('./network');
const { applyFullProviderFromVps, removeProviderByName, refreshModelsIfChanged, isFullProvider } = require('./openclaw-provider');
const led = require('./led');
@@ -371,8 +371,9 @@ class ClawClient {
box_id: this._boxId,
claw_id: this._cfg.claw_id ?? null,
token: this._cfg.token ?? null,
local_ip: getLocalIps(),
external_ip: this._externalIp ?? null,
local_ip: getLocalIps(),
local_networks: getLocalNetworks(),
external_ip: this._externalIp ?? null,
location: this._location ?? null,
...this._dashInfo,
};
@@ -595,8 +596,10 @@ class ClawClient {
// 每 METRICS_EVERY_N 次心跳30 秒)采集一次指标,其余发轻量心跳
const msg = {
type: 'heartbeat',
claw_id: this._cfg.claw_id,
token: this._cfg.token,
claw_id: this._cfg.claw_id,
token: this._cfg.token,
local_ip: getLocalIps(),
local_networks: getLocalNetworks(),
...this._dashInfo,
};
if (this._hbCount % METRICS_EVERY_N === 0) {