mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
Userland: Make representation of 'null' IPv4-address friendlier
Show an empty column rather than 'null' in SystemMonitor and show 'no IP' in the network applet if the adapter has no IPv4-address configured.
This commit is contained in:
committed by
Gunnar Beutner
parent
3a40287776
commit
df6db8b8cc
@@ -56,7 +56,10 @@ NetworkStatisticsWidget::NetworkStatisticsWidget()
|
||||
return String::formatted("{} Mb/s {}-duplex", object.get("link_speed").to_i32(),
|
||||
object.get("link_full_duplex").as_bool() ? "full" : "half");
|
||||
});
|
||||
net_adapters_fields.empend("ipv4_address", "IPv4", Gfx::TextAlignment::CenterLeft);
|
||||
net_adapters_fields.empend("IPv4", Gfx::TextAlignment::CenterLeft,
|
||||
[this](JsonObject const& object) -> String {
|
||||
return object.get("ipv4_address").as_string_or("");
|
||||
});
|
||||
net_adapters_fields.empend("packets_in", "Pkt In", Gfx::TextAlignment::CenterRight);
|
||||
net_adapters_fields.empend("packets_out", "Pkt Out", Gfx::TextAlignment::CenterRight);
|
||||
net_adapters_fields.empend("bytes_in", "Bytes In", Gfx::TextAlignment::CenterRight);
|
||||
|
||||
Reference in New Issue
Block a user