refactor: remove monitor legacy compatibility
This commit is contained in:
@@ -20,8 +20,12 @@ HarborForge.OpenclawPlugin/
|
|||||||
│ ├── openclaw.plugin.json
|
│ ├── openclaw.plugin.json
|
||||||
│ ├── index.ts
|
│ ├── index.ts
|
||||||
│ ├── core/
|
│ ├── core/
|
||||||
│ │ ├── live-config.ts
|
│ │ ├── config.ts
|
||||||
|
│ │ ├── managed-monitor.ts
|
||||||
│ │ └── monitor-bridge.ts
|
│ │ └── monitor-bridge.ts
|
||||||
|
│ ├── hooks/
|
||||||
|
│ │ ├── gateway-start.ts
|
||||||
|
│ │ └── gateway-stop.ts
|
||||||
│ └── package.json
|
│ └── package.json
|
||||||
├── skills/
|
├── skills/
|
||||||
│ └── hf/
|
│ └── hf/
|
||||||
@@ -98,8 +102,6 @@ node scripts/install.mjs --uninstall
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
> 说明:`monitor_port` 是当前主字段;为兼容旧配置,插件仍接受 `monitorPort`。
|
|
||||||
|
|
||||||
然后重启:
|
然后重启:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -63,11 +63,10 @@ export default {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the monitor bridge client if monitor_port is configured.
|
* Get the monitor bridge client if monitor_port is configured.
|
||||||
* Legacy alias monitorPort is still accepted.
|
|
||||||
*/
|
*/
|
||||||
function getBridgeClient(): MonitorBridgeClient | null {
|
function getBridgeClient(): MonitorBridgeClient | null {
|
||||||
const live = resolveConfig() as any;
|
const live = resolveConfig();
|
||||||
const port = live.monitor_port ?? live.monitorPort;
|
const port = live.monitor_port;
|
||||||
if (!port || port <= 0) return null;
|
if (!port || port <= 0) return null;
|
||||||
return new MonitorBridgeClient(port);
|
return new MonitorBridgeClient(port);
|
||||||
}
|
}
|
||||||
@@ -349,7 +348,7 @@ export default {
|
|||||||
config: {
|
config: {
|
||||||
backendUrl: live.backendUrl,
|
backendUrl: live.backendUrl,
|
||||||
identifier: live.identifier || hostname(),
|
identifier: live.identifier || hostname(),
|
||||||
monitorPort: (live as any).monitor_port ?? (live as any).monitorPort ?? null,
|
monitorPort: live.monitor_port ?? null,
|
||||||
reportIntervalSec: live.reportIntervalSec,
|
reportIntervalSec: live.reportIntervalSec,
|
||||||
hasApiKey: Boolean(live.apiKey),
|
hasApiKey: Boolean(live.apiKey),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -403,7 +403,7 @@ function summary() {
|
|||||||
log('Next steps:', 'blue');
|
log('Next steps:', 'blue');
|
||||||
log(' 1. Register server in HarborForge Monitor to get apiKey', 'cyan');
|
log(' 1. Register server in HarborForge Monitor to get apiKey', 'cyan');
|
||||||
log(' 2. Edit ~/.openclaw/openclaw.json under plugins.entries.harbor-forge.config:', 'cyan');
|
log(' 2. Edit ~/.openclaw/openclaw.json under plugins.entries.harbor-forge.config:', 'cyan');
|
||||||
log(' (prefer monitor_port; legacy monitorPort is still accepted)', 'cyan');
|
log(' (monitor_port is required for the local monitor bridge)', 'cyan');
|
||||||
log(' {', 'cyan');
|
log(' {', 'cyan');
|
||||||
log(' "plugins": {', 'cyan');
|
log(' "plugins": {', 'cyan');
|
||||||
log(' "entries": {', 'cyan');
|
log(' "entries": {', 'cyan');
|
||||||
|
|||||||
Reference in New Issue
Block a user