Implement multi-host autoconnect with consolidated host configuration

- Add DEFAULT_HOSTS constant in config.rs for centralized host management
- Update ZMQ endpoint generation to connect to all configured hosts
- Implement graceful connection handling for unreachable endpoints
- Dashboard now auto-discovers and connects to available agents on cmbox, labbox, simonbox, steambox, srv01
This commit is contained in:
2025-10-14 00:44:38 +02:00
parent c8655bf852
commit dca3642e46
3 changed files with 46 additions and 13 deletions

View File

@@ -129,10 +129,22 @@ const fn default_tick_rate_ms() -> u64 {
500
}
/// Default hosts for auto-discovery
pub const DEFAULT_HOSTS: &[&str] = &[
"cmbox", "labbox", "simonbox", "steambox", "srv01"
];
fn default_data_source_config() -> DataSourceConfig {
DataSourceConfig::default()
}
fn default_zmq_endpoints() -> Vec<String> {
vec!["tcp://127.0.0.1:6130".to_string()]
// Default endpoints include localhost and all known CMTEC hosts
let mut endpoints = vec!["tcp://127.0.0.1:6130".to_string()];
for host in DEFAULT_HOSTS {
endpoints.push(format!("tcp://{}:6130", host));
}
endpoints
}