Align plugin monitor_port config

This commit is contained in:
zhi
2026-03-21 19:22:44 +00:00
parent 78a61e0fb2
commit 27b8b74d39
11 changed files with 119 additions and 115 deletions

View File

@@ -3,6 +3,7 @@ export interface HarborForgeMonitorConfig {
backendUrl?: string;
identifier?: string;
apiKey?: string;
monitor_port?: number;
monitorPort?: number;
reportIntervalSec?: number;
httpFallbackIntervalSec?: number;
@@ -24,9 +25,20 @@ export function getLivePluginConfig(
const cfg = (entry.config as Record<string, unknown>) || {};
if (Object.keys(cfg).length > 0 || Object.keys(entry).length > 0) {
const monitorPort =
typeof cfg.monitor_port === 'number'
? cfg.monitor_port
: typeof cfg.monitorPort === 'number'
? cfg.monitorPort
: typeof fallback.monitor_port === 'number'
? fallback.monitor_port
: fallback.monitorPort;
return {
...fallback,
...cfg,
monitor_port: monitorPort,
monitorPort,
enabled:
typeof cfg.enabled === 'boolean'
? cfg.enabled