Repository: fujiapple852/trippy (language: rust)

Issue:
IcmpExtensionMode not shown in settings



Discussion / hints:

Fix patch:
diff --git a/crates/trippy-tui/src/frontend/render/settings.rs b/crates/trippy-tui/src/frontend/render/settings.rs
index a676ae4a5..b307aa7c5 100644
--- a/crates/trippy-tui/src/frontend/render/settings.rs
+++ b/crates/trippy-tui/src/frontend/render/settings.rs
@@ -1,4 +1,4 @@
-use crate::config::{AddressMode, AsMode, GeoIpMode};
+use crate::config::{AddressMode, AsMode, GeoIpMode, IcmpExtensionMode};
 use crate::frontend::render::util;
 use crate::frontend::theme;
 use crate::frontend::tui_app::TuiApp;
@@ -178,6 +178,10 @@ fn format_tui_settings(app: &TuiApp) -> Vec<SettingsItem> {
             format_address_mode(app.tui_config.address_mode),
         ),
         SettingsItem::new("tui-as-mode", format_as_mode(app.tui_config.as_mode)),
+        SettingsItem::new(
+            "tui-icmp-extension-mode",
+            format_extension_mode(app.tui_config.icmp_extension_mode),
+        ),
         SettingsItem::new(
             "tui-geoip-mode",
             format_geoip_mode(app.tui_config.geoip_mode),
@@ -495,7 +499,7 @@ pub const SETTINGS_TAB_COLUMNS: usize = 6;
 
 /// The name and number of items for each tabs in the setting dialog.
 pub const SETTINGS_TABS: [(&str, usize); 7] = [
-    ("Tui", 8),
+    ("Tui", 9),
     ("Trace", 17),
     ("Dns", 5),
     ("GeoIp", 1),
@@ -537,6 +541,15 @@ fn format_dns_method(resolve_method: ResolveMethod) -> String {
     }
 }
 
+fn format_extension_mode(icmp_extension_mode: IcmpExtensionMode) -> String {
+    match icmp_extension_mode {
+        IcmpExtensionMode::Off => "off".to_string(),
+        IcmpExtensionMode::Mpls => "mpls".to_string(),
+        IcmpExtensionMode::Full => "full".to_string(),
+        IcmpExtensionMode::All => "all".to_string(),
+    }
+}
+
 /// Format the `AsMode`.
 fn format_as_mode(as_mode: AsMode) -> String {
     match as_mode {


Test patch: