diff --git a/src/trx-client/src/config.rs b/src/trx-client/src/config.rs index 93f1e0a..15a0722 100644 --- a/src/trx-client/src/config.rs +++ b/src/trx-client/src/config.rs @@ -269,7 +269,8 @@ pub struct HttpFrontendConfig { /// Listen port pub port: u16, /// Default rig selected in the web UI on startup. - pub default_rig_id: Option, + #[serde(alias = "default_rig_id")] + pub default_rig_name: Option, /// Initial zoom level for the APRS map when receiver coordinates are known. pub initial_map_zoom: u8, /// Spectrum center-retune guard margin on each side of the selected bandwidth. @@ -292,7 +293,7 @@ impl Default for HttpFrontendConfig { enabled: true, listen: IpAddr::from([127, 0, 0, 1]), port: 8080, - default_rig_id: None, + default_rig_name: None, initial_map_zoom: 10, spectrum_coverage_margin_hz: 50_000, spectrum_usable_span_ratio: 0.92, @@ -479,10 +480,10 @@ impl ClientConfig { if self.frontends.http.enabled && self.frontends.http.port == 0 { return Err("[frontends.http].port must be > 0 when enabled".to_string()); } - if let Some(rig_id) = &self.frontends.http.default_rig_id { + if let Some(rig_id) = &self.frontends.http.default_rig_name { if rig_id.trim().is_empty() { return Err( - "[frontends.http].default_rig_id must not be empty when set".to_string() + "[frontends.http].default_rig_name must not be empty when set".to_string() ); } } @@ -623,7 +624,7 @@ impl ClientConfig { enabled: true, listen: IpAddr::from([127, 0, 0, 1]), port: 8080, - default_rig_id: Some("home-hf".to_string()), + default_rig_name: Some("home-hf".to_string()), initial_map_zoom: 10, spectrum_coverage_margin_hz: 50_000, spectrum_usable_span_ratio: 0.92, diff --git a/src/trx-client/src/main.rs b/src/trx-client/src/main.rs index c981afa..611d9a9 100644 --- a/src/trx-client/src/main.rs +++ b/src/trx-client/src/main.rs @@ -223,7 +223,7 @@ async fn async_init() -> DynResult { let default_rig = cli .rig_id .clone() - .or_else(|| cfg.frontends.http.default_rig_id.clone()) + .or_else(|| cfg.frontends.http.default_rig_name.clone()) .or_else(|| resolved_remotes.first().map(|e| e.name.clone())); if let Ok(mut guard) = frontend_runtime.remote_active_rig_id.lock() { *guard = default_rig.clone();