fix(network): restore IPv4 display and wifi list ordering
- Strip the CIDR suffix (/24) from the shown IPv4 address - Sort visible wireless networks by signal strength again - Filter out empty-SSID "hidden network" entries from the list
This commit is contained in:
parent
a3be51560f
commit
f69e943d91
1 changed files with 6 additions and 1 deletions
|
|
@ -456,6 +456,9 @@ fn ip_address_elements<'a>(
|
||||||
) -> Vec<Element<'a, Message>> {
|
) -> Vec<Element<'a, Message>> {
|
||||||
let mut elements = Vec::with_capacity(1);
|
let mut elements = Vec::with_capacity(1);
|
||||||
if let Some(addr) = ip4_address {
|
if let Some(addr) = ip4_address {
|
||||||
|
// Strip the subnet mask (e.g. "10.0.0.2/24" -> "10.0.0.2"); the drop-down
|
||||||
|
// only needs the address itself for glancing at the host on a local network.
|
||||||
|
let addr = addr.split('/').next().unwrap_or(addr.as_str());
|
||||||
elements.push(text(format!("{}: {}", fl!("ipv4"), addr)).size(12).into());
|
elements.push(text(format!("{}: {}", fl!("ipv4"), addr)).size(12).into());
|
||||||
}
|
}
|
||||||
elements
|
elements
|
||||||
|
|
@ -629,9 +632,10 @@ fn snapshot_to_applet(snapshot: NetworkSnapshot) -> AppletSnapshot {
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let wireless_access_points = summary
|
let mut wireless_access_points = summary
|
||||||
.wifi_groups
|
.wifi_groups
|
||||||
.iter()
|
.iter()
|
||||||
|
.filter(|group| !group.ssid.is_empty())
|
||||||
.map(|group| {
|
.map(|group| {
|
||||||
let strongest = &group.strongest;
|
let strongest = &group.strongest;
|
||||||
AccessPoint {
|
AccessPoint {
|
||||||
|
|
@ -646,6 +650,7 @@ fn snapshot_to_applet(snapshot: NetworkSnapshot) -> AppletSnapshot {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
wireless_access_points.sort_by(|a, b| b.strength.cmp(&a.strength));
|
||||||
|
|
||||||
let known_access_points = summary
|
let known_access_points = summary
|
||||||
.wifi_groups
|
.wifi_groups
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue