remove statisticsFreshRate

This commit is contained in:
2dust 2023-06-04 16:14:17 +08:00
parent d263a78db8
commit 8adbc57f23
11 changed files with 5 additions and 63 deletions

View file

@ -140,7 +140,6 @@ namespace v2rayN.Handler
config.guiItem = new() config.guiItem = new()
{ {
enableStatistics = false, enableStatistics = false,
statisticsFreshRate = 1,
}; };
} }
if (config.uiItem == null) if (config.uiItem == null)
@ -185,11 +184,6 @@ namespace v2rayN.Handler
config.speedTestItem.speedPingTestUrl = Global.SpeedPingTestUrl; config.speedTestItem.speedPingTestUrl = Global.SpeedPingTestUrl;
} }
if (config.guiItem.statisticsFreshRate is > 100 or < 1)
{
config.guiItem.statisticsFreshRate = 1;
}
if (config.mux4Sbox == null) if (config.mux4Sbox == null)
{ {
config.mux4Sbox = new() config.mux4Sbox = new()
@ -331,7 +325,6 @@ namespace v2rayN.Handler
config.guiItem = new() config.guiItem = new()
{ {
enableStatistics = configOld.enableStatistics, enableStatistics = configOld.enableStatistics,
statisticsFreshRate = configOld.statisticsFreshRate,
keepOlderDedupl = configOld.keepOlderDedupl, keepOlderDedupl = configOld.keepOlderDedupl,
ignoreGeoUpdateCore = configOld.ignoreGeoUpdateCore, ignoreGeoUpdateCore = configOld.ignoreGeoUpdateCore,
autoUpdateInterval = configOld.autoUpdateInterval, autoUpdateInterval = configOld.autoUpdateInterval,

View file

@ -61,8 +61,7 @@ namespace v2rayN.Handler
_updateFunc(server); _updateFunc(server);
} }
} }
var sleep = _config.guiItem.statisticsFreshRate < 1 ? 1 : _config.guiItem.statisticsFreshRate; await Task.Delay(1000);
await Task.Delay(1000 * sleep);
await _channel.ConnectAsync(); await _channel.ConnectAsync();
} }
catch catch

View file

@ -88,8 +88,6 @@ namespace v2rayN.Mode
public bool enableStatistics { get; set; } public bool enableStatistics { get; set; }
public int statisticsFreshRate { get; set; }
public bool keepOlderDedupl { get; set; } public bool keepOlderDedupl { get; set; }
public bool ignoreGeoUpdateCore { get; set; } = true; public bool ignoreGeoUpdateCore { get; set; } = true;

View file

@ -2752,15 +2752,6 @@ namespace v2rayN.Resx {
} }
} }
/// <summary>
/// 查找类似 Statistics freshrate (second) 的本地化字符串。
/// </summary>
public static string TbSettingsStatisticsFreshRate {
get {
return ResourceManager.GetString("TbSettingsStatisticsFreshRate", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 Subscription conversion Url 的本地化字符串。 /// 查找类似 Subscription conversion Url 的本地化字符串。
/// </summary> /// </summary>

View file

@ -793,9 +793,6 @@
<data name="TbSettingsStatistics" xml:space="preserve"> <data name="TbSettingsStatistics" xml:space="preserve">
<value>فعال کردن آمار (نیاز به راه اندازی مجدد)</value> <value>فعال کردن آمار (نیاز به راه اندازی مجدد)</value>
</data> </data>
<data name="TbSettingsStatisticsFreshRate" xml:space="preserve">
<value>نرخ تازه سازی آمار (ثانیه)</value>
</data>
<data name="TbSettingsSubConvert" xml:space="preserve"> <data name="TbSettingsSubConvert" xml:space="preserve">
<value>Subscription conversion Url</value> <value>Subscription conversion Url</value>
</data> </data>

View file

@ -796,9 +796,6 @@
<data name="TbSettingsStatistics" xml:space="preserve"> <data name="TbSettingsStatistics" xml:space="preserve">
<value>Enable Statistics (Require restart)</value> <value>Enable Statistics (Require restart)</value>
</data> </data>
<data name="TbSettingsStatisticsFreshRate" xml:space="preserve">
<value>Statistics freshrate (second)</value>
</data>
<data name="TbSettingsSubConvert" xml:space="preserve"> <data name="TbSettingsSubConvert" xml:space="preserve">
<value>Subscription conversion Url</value> <value>Subscription conversion Url</value>
</data> </data>

View file

@ -796,9 +796,6 @@
<data name="TbSettingsStatistics" xml:space="preserve"> <data name="TbSettingsStatistics" xml:space="preserve">
<value>Включить статистику (требуется перезагрузка)</value> <value>Включить статистику (требуется перезагрузка)</value>
</data> </data>
<data name="TbSettingsStatisticsFreshRate" xml:space="preserve">
<value>Частота обновления статистики в секундах</value>
</data>
<data name="TbSettingsSubConvert" xml:space="preserve"> <data name="TbSettingsSubConvert" xml:space="preserve">
<value>URL-адрес конверсии подписки</value> <value>URL-адрес конверсии подписки</value>
</data> </data>

View file

@ -796,9 +796,6 @@
<data name="TbSettingsStatistics" xml:space="preserve"> <data name="TbSettingsStatistics" xml:space="preserve">
<value>启用统计(实时网速显示,需重启)</value> <value>启用统计(实时网速显示,需重启)</value>
</data> </data>
<data name="TbSettingsStatisticsFreshRate" xml:space="preserve">
<value>统计刷新频率(单位秒)</value>
</data>
<data name="TbSettingsSubConvert" xml:space="preserve"> <data name="TbSettingsSubConvert" xml:space="preserve">
<value>订阅转换网址(可选)</value> <value>订阅转换网址(可选)</value>
</data> </data>

View file

@ -51,7 +51,6 @@ namespace v2rayN.ViewModels
[Reactive] public bool AutoRun { get; set; } [Reactive] public bool AutoRun { get; set; }
[Reactive] public bool EnableStatistics { get; set; } [Reactive] public bool EnableStatistics { get; set; }
[Reactive] public int StatisticsFreshRate { get; set; }
[Reactive] public bool KeepOlderDedupl { get; set; } [Reactive] public bool KeepOlderDedupl { get; set; }
[Reactive] public bool IgnoreGeoUpdateCore { get; set; } [Reactive] public bool IgnoreGeoUpdateCore { get; set; }
[Reactive] public bool EnableAutoAdjustMainLvColWidth { get; set; } [Reactive] public bool EnableAutoAdjustMainLvColWidth { get; set; }
@ -141,7 +140,6 @@ namespace v2rayN.ViewModels
AutoRun = _config.guiItem.autoRun; AutoRun = _config.guiItem.autoRun;
EnableStatistics = _config.guiItem.enableStatistics; EnableStatistics = _config.guiItem.enableStatistics;
StatisticsFreshRate = _config.guiItem.statisticsFreshRate;
KeepOlderDedupl = _config.guiItem.keepOlderDedupl; KeepOlderDedupl = _config.guiItem.keepOlderDedupl;
IgnoreGeoUpdateCore = _config.guiItem.ignoreGeoUpdateCore; IgnoreGeoUpdateCore = _config.guiItem.ignoreGeoUpdateCore;
EnableAutoAdjustMainLvColWidth = _config.uiItem.enableAutoAdjustMainLvColWidth; EnableAutoAdjustMainLvColWidth = _config.uiItem.enableAutoAdjustMainLvColWidth;
@ -291,11 +289,6 @@ namespace v2rayN.ViewModels
Utils.SetAutoRun(AutoRun); Utils.SetAutoRun(AutoRun);
_config.guiItem.autoRun = AutoRun; _config.guiItem.autoRun = AutoRun;
_config.guiItem.enableStatistics = EnableStatistics; _config.guiItem.enableStatistics = EnableStatistics;
_config.guiItem.statisticsFreshRate = StatisticsFreshRate;
if (_config.guiItem.statisticsFreshRate > 100 || _config.guiItem.statisticsFreshRate < 1)
{
_config.guiItem.statisticsFreshRate = 1;
}
_config.guiItem.keepOlderDedupl = KeepOlderDedupl; _config.guiItem.keepOlderDedupl = KeepOlderDedupl;
_config.guiItem.ignoreGeoUpdateCore = IgnoreGeoUpdateCore; _config.guiItem.ignoreGeoUpdateCore = IgnoreGeoUpdateCore;
_config.uiItem.enableAutoAdjustMainLvColWidth = EnableAutoAdjustMainLvColWidth; _config.uiItem.enableAutoAdjustMainLvColWidth = EnableAutoAdjustMainLvColWidth;

View file

@ -1,12 +1,12 @@
<reactiveui:ReactiveWindow <reactiveui:ReactiveWindow
x:Class="v2rayN.Views.OptionSettingWindow" x:Class="v2rayN.Views.OptionSettingWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:conv="clr-namespace:v2rayN.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:reactiveui="http://reactiveui.net" xmlns:reactiveui="http://reactiveui.net"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:conv="clr-namespace:v2rayN.Converters"
xmlns:resx="clr-namespace:v2rayN.Resx" xmlns:resx="clr-namespace:v2rayN.Resx"
xmlns:vms="clr-namespace:v2rayN.ViewModels" xmlns:vms="clr-namespace:v2rayN.ViewModels"
Title="{x:Static resx:ResUI.menuSetting}" Title="{x:Static resx:ResUI.menuSetting}"
@ -498,21 +498,6 @@
Margin="{StaticResource SettingItemMargin}" Margin="{StaticResource SettingItemMargin}"
HorizontalAlignment="Left" /> HorizontalAlignment="Left" />
<TextBlock
Grid.Row="3"
Grid.Column="0"
Margin="{StaticResource SettingItemMargin}"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsStatisticsFreshRate}" />
<ComboBox
x:Name="cmbStatisticsFreshRate"
Grid.Row="3"
Grid.Column="1"
Width="200"
Margin="{StaticResource SettingItemMargin}"
Style="{StaticResource DefComboBox}" />
<TextBlock <TextBlock
Grid.Row="4" Grid.Row="4"
Grid.Column="0" Grid.Column="0"

View file

@ -44,10 +44,6 @@ namespace v2rayN.Views
cmbmux4SboxProtocol.Items.Add(it); cmbmux4SboxProtocol.Items.Add(it);
}); });
for (int i = 1; i <= 10; i++)
{
cmbStatisticsFreshRate.Items.Add(i);
}
Global.TunMtus.ForEach(it => Global.TunMtus.ForEach(it =>
{ {
cmbMtu.Items.Add(it); cmbMtu.Items.Add(it);
@ -150,7 +146,6 @@ namespace v2rayN.Views
this.Bind(ViewModel, vm => vm.AutoRun, v => v.togAutoRun.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.AutoRun, v => v.togAutoRun.IsChecked).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.EnableStatistics, v => v.togEnableStatistics.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.EnableStatistics, v => v.togEnableStatistics.IsChecked).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.StatisticsFreshRate, v => v.cmbStatisticsFreshRate.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.KeepOlderDedupl, v => v.togKeepOlderDedupl.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.KeepOlderDedupl, v => v.togKeepOlderDedupl.IsChecked).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.IgnoreGeoUpdateCore, v => v.togIgnoreGeoUpdateCore.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.IgnoreGeoUpdateCore, v => v.togIgnoreGeoUpdateCore.IsChecked).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.EnableAutoAdjustMainLvColWidth, v => v.togEnableAutoAdjustMainLvColWidth.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.EnableAutoAdjustMainLvColWidth, v => v.togEnableAutoAdjustMainLvColWidth.IsChecked).DisposeWith(disposables);