diff --git a/v2rayN/ServiceLib/Models/Configs/ConfigItems.cs b/v2rayN/ServiceLib/Models/Configs/ConfigItems.cs index 93ef681e..6771d6b0 100644 --- a/v2rayN/ServiceLib/Models/Configs/ConfigItems.cs +++ b/v2rayN/ServiceLib/Models/Configs/ConfigItems.cs @@ -103,6 +103,7 @@ public class UIItem public bool MacOSShowInDock { get; set; } public List MainColumnItem { get; set; } public List WindowSizeItem { get; set; } + public bool HideColumnIpInfo { get; set; } } [Serializable] diff --git a/v2rayN/ServiceLib/Services/SpeedtestService.cs b/v2rayN/ServiceLib/Services/SpeedtestService.cs index 44e95fcb..af0a5d04 100644 --- a/v2rayN/ServiceLib/Services/SpeedtestService.cs +++ b/v2rayN/ServiceLib/Services/SpeedtestService.cs @@ -425,7 +425,7 @@ public class SpeedtestService(Config config, Func updateF ProfileExManager.Instance.SetTestDelay(it.IndexId, responseTime); await UpdateFunc(it.IndexId, responseTime.ToString()); - if (responseTime > 0) + if (!_config.UiItem.HideColumnIpInfo && responseTime > 0) { var ipInfo = await ConnectionHandler.GetIPInfo(webProxy); var ipStr = ipInfo?.ToString() ?? Global.None; diff --git a/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs b/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs index 3d9ddd57..3d7ae00c 100644 --- a/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs @@ -431,7 +431,7 @@ public partial class ProfilesView : ReactiveUserControl } if (item.Name.Equals("IpInfo", StringComparison.CurrentCultureIgnoreCase)) { - item2.IsVisible = _config.SpeedTestItem.IPAPIUrl.IsNotEmpty(); + item2.IsVisible = _config.SpeedTestItem.IPAPIUrl.IsNotEmpty() && !_config.UiItem.HideColumnIpInfo; } } } diff --git a/v2rayN/v2rayN/Views/ProfilesView.xaml.cs b/v2rayN/v2rayN/Views/ProfilesView.xaml.cs index 1ee8524f..a828fba7 100644 --- a/v2rayN/v2rayN/Views/ProfilesView.xaml.cs +++ b/v2rayN/v2rayN/Views/ProfilesView.xaml.cs @@ -384,7 +384,7 @@ public partial class ProfilesView } if (item.Name.Equals("IpInfo", StringComparison.CurrentCultureIgnoreCase)) { - item2.Visibility = _config.SpeedTestItem.IPAPIUrl.IsNotEmpty() ? Visibility.Visible : Visibility.Hidden; + item2.Visibility = _config.SpeedTestItem.IPAPIUrl.IsNotEmpty() && !_config.UiItem.HideColumnIpInfo ? Visibility.Visible : Visibility.Hidden; } } }