diff --git a/Cargo.lock b/Cargo.lock index e7e640d..d3f8c35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -270,7 +270,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" [[package]] name = "cm-dashboard" -version = "0.1.67" +version = "0.1.68" dependencies = [ "anyhow", "chrono", @@ -292,7 +292,7 @@ dependencies = [ [[package]] name = "cm-dashboard-agent" -version = "0.1.67" +version = "0.1.68" dependencies = [ "anyhow", "async-trait", @@ -315,7 +315,7 @@ dependencies = [ [[package]] name = "cm-dashboard-shared" -version = "0.1.67" +version = "0.1.68" dependencies = [ "chrono", "serde", diff --git a/agent/Cargo.toml b/agent/Cargo.toml index 5cd0dbd..4c5a37c 100644 --- a/agent/Cargo.toml +++ b/agent/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-agent" -version = "0.1.68" +version = "0.1.69" edition = "2021" [dependencies] diff --git a/dashboard/Cargo.toml b/dashboard/Cargo.toml index 99d4726..bd2777a 100644 --- a/dashboard/Cargo.toml +++ b/dashboard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard" -version = "0.1.68" +version = "0.1.69" edition = "2021" [dependencies] diff --git a/dashboard/src/config/mod.rs b/dashboard/src/config/mod.rs index 3422903..3c255b7 100644 --- a/dashboard/src/config/mod.rs +++ b/dashboard/src/config/mod.rs @@ -62,11 +62,11 @@ impl HostDetails { } } "auto" | _ => { - // Try tailscale first, then local, then hostname - if let Some(ref ts_ip) = self.tailscale_ip { - ts_ip.clone() - } else if let Some(ref local_ip) = self.ip { + // Try local first, then tailscale, then hostname + if let Some(ref local_ip) = self.ip { local_ip.clone() + } else if let Some(ref ts_ip) = self.tailscale_ip { + ts_ip.clone() } else { hostname.to_string() } @@ -81,18 +81,19 @@ impl HostDetails { // Add all available IPs except the primary one let primary = self.get_connection_ip(hostname); - if let Some(ref ts_ip) = self.tailscale_ip { - if ts_ip != &primary { - fallbacks.push(ts_ip.clone()); - } - } - + // Add fallbacks in priority order: local first, then tailscale if let Some(ref local_ip) = self.ip { if local_ip != &primary { fallbacks.push(local_ip.clone()); } } + if let Some(ref ts_ip) = self.tailscale_ip { + if ts_ip != &primary { + fallbacks.push(ts_ip.clone()); + } + } + // Always include hostname as final fallback if not already primary if hostname != primary { fallbacks.push(hostname.to_string()); diff --git a/shared/Cargo.toml b/shared/Cargo.toml index fb461ed..0af1508 100644 --- a/shared/Cargo.toml +++ b/shared/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-shared" -version = "0.1.68" +version = "0.1.69" edition = "2021" [dependencies]