Align plugin monitor_port config
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user