Align plugin monitor_port config
This commit is contained in:
@@ -52,11 +52,12 @@ export default {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the monitor bridge client if monitorPort is configured.
|
||||
* Get the monitor bridge client if monitor_port is configured.
|
||||
* Legacy alias monitorPort is still accepted.
|
||||
*/
|
||||
function getBridgeClient(): MonitorBridgeClient | null {
|
||||
const live = resolveConfig() as any;
|
||||
const port = live.monitorPort;
|
||||
const port = live.monitor_port ?? live.monitorPort;
|
||||
if (!port || port <= 0) return null;
|
||||
return new MonitorBridgeClient(port);
|
||||
}
|
||||
@@ -125,7 +126,7 @@ export default {
|
||||
config: {
|
||||
backendUrl: live.backendUrl,
|
||||
identifier: live.identifier || hostname(),
|
||||
monitorPort: (live as any).monitorPort || null,
|
||||
monitorPort: (live as any).monitor_port ?? (live as any).monitorPort ?? null,
|
||||
reportIntervalSec: live.reportIntervalSec,
|
||||
hasApiKey: Boolean(live.apiKey),
|
||||
},
|
||||
@@ -160,7 +161,7 @@ export default {
|
||||
const bridgeClient = getBridgeClient();
|
||||
if (!bridgeClient) {
|
||||
return {
|
||||
error: 'Monitor bridge not configured (monitorPort not set or 0)',
|
||||
error: 'Monitor bridge not configured (monitor_port not set or 0)',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user