Add setting 4 SpeedPingTestUrl

pull/4711/head
2dust 2024-01-30 18:04:10 +08:00
parent c466ea100a
commit fc52870431
10 changed files with 64 additions and 20 deletions

View File

@ -118,6 +118,9 @@ namespace v2rayN
@"http://cachefly.cachefly.net/100mb.test",
@"http://cachefly.cachefly.net/10mb.test"
};
public static readonly List<string> SpeedPingTestUrls = new() {
@"https://www.google.com/generate_204",
};
public static readonly Dictionary<string, string> UserAgentTxts = new()
{

View File

@ -123,7 +123,6 @@ namespace v2rayN.Mode
public bool doubleClick2Activate { get; set; }
public bool autoHideStartup { get; set; } = true;
public string mainMsgFilter { get; set; }
public bool showTrayTip { get; set; }
public List<ColumnItem> mainColumnItem { get; set; }
}

View File

@ -2851,6 +2851,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 Speed Ping Test Url 的本地化字符串。
/// </summary>
public static string TbSettingsSpeedPingTestUrl {
get {
return ResourceManager.GetString("TbSettingsSpeedPingTestUrl", resourceCulture);
}
}
/// <summary>
/// 查找类似 SpeedTest Single Timeout Value 的本地化字符串。
/// </summary>

View File

@ -1189,4 +1189,7 @@
<data name="TbAutoScrollToEnd" xml:space="preserve">
<value>Auto ScrollToEnd</value>
</data>
<data name="TbSettingsSpeedPingTestUrl" xml:space="preserve">
<value>Speed Ping Test Url</value>
</data>
</root>

View File

@ -1186,4 +1186,7 @@
<data name="TbAutoScrollToEnd" xml:space="preserve">
<value>自动滚动到末尾</value>
</data>
<data name="TbSettingsSpeedPingTestUrl" xml:space="preserve">
<value>真连接测试地址</value>
</data>
</root>

View File

@ -1159,4 +1159,7 @@
<data name="TbAutoScrollToEnd" xml:space="preserve">
<value>自动滚动到末尾</value>
</data>
<data name="TbSettingsSpeedPingTestUrl" xml:space="preserve">
<value>真連接測試地址</value>
</data>
</root>

View File

@ -1700,7 +1700,6 @@ namespace v2rayN.ViewModels
}
CurrentFontSize = _config.uiItem.currentFontSize;
CurrentLanguage = _config.uiItem.currentLanguage;
//BlShowTrayTip = _config.uiItem.showTrayTip;
this.WhenAnyValue(
x => x.ColorModeDark,

View File

@ -66,6 +66,7 @@ namespace v2rayN.ViewModels
[Reactive] public string currentFontFamily { get; set; }
[Reactive] public int SpeedTestTimeout { get; set; }
[Reactive] public string SpeedTestUrl { get; set; }
[Reactive] public string SpeedPingTestUrl { get; set; }
[Reactive] public bool EnableHWA { get; set; }
[Reactive] public string SubConvertUrl { get; set; }
@ -159,6 +160,7 @@ namespace v2rayN.ViewModels
currentFontFamily = _config.uiItem.currentFontFamily;
SpeedTestTimeout = _config.speedTestItem.speedTestTimeout;
SpeedTestUrl = _config.speedTestItem.speedTestUrl;
SpeedPingTestUrl = _config.speedTestItem.speedPingTestUrl;
EnableHWA = _config.guiItem.enableHWA;
SubConvertUrl = _config.constItem.subConvertUrl;
@ -312,6 +314,7 @@ namespace v2rayN.ViewModels
_config.uiItem.currentFontFamily = currentFontFamily;
_config.speedTestItem.speedTestTimeout = SpeedTestTimeout;
_config.speedTestItem.speedTestUrl = SpeedTestUrl;
_config.speedTestItem.speedPingTestUrl = SpeedPingTestUrl;
_config.guiItem.enableHWA = EnableHWA;
_config.constItem.subConvertUrl = SubConvertUrl;

View File

@ -482,6 +482,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
@ -643,10 +644,24 @@
Margin="{StaticResource SettingItemMargin}"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsEnableHWA}" />
<ToggleButton
x:Name="togEnableHWA"
Grid.Row="12"
Grid.Column="1"
Margin="{StaticResource SettingItemMargin}"
HorizontalAlignment="Left" />
<TextBlock
Grid.Row="14"
Grid.Column="0"
Margin="{StaticResource SettingItemMargin}"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsAutoUpdateInterval}" />
<TextBox
x:Name="txtautoUpdateInterval"
Grid.Row="12"
Grid.Row="14"
Grid.Column="1"
Width="200"
Margin="{StaticResource SettingItemMargin}"
@ -654,7 +669,7 @@
Style="{StaticResource DefTextBox}" />
<TextBlock
Grid.Row="14"
Grid.Row="15"
Grid.Column="0"
Margin="{StaticResource SettingItemMargin}"
VerticalAlignment="Center"
@ -662,7 +677,7 @@
Text="{x:Static resx:ResUI.TbSettingsTrayMenuServersLimit}" />
<TextBox
x:Name="txttrayMenuServersLimit"
Grid.Row="14"
Grid.Row="15"
Grid.Column="1"
Width="200"
Margin="{StaticResource SettingItemMargin}"
@ -670,7 +685,7 @@
Style="{StaticResource DefTextBox}" />
<TextBlock
Grid.Row="15"
Grid.Row="16"
Grid.Column="0"
Margin="{StaticResource SettingItemMargin}"
VerticalAlignment="Center"
@ -678,14 +693,14 @@
Text="{x:Static resx:ResUI.TbSettingsCurrentFontFamily}" />
<ComboBox
x:Name="cmbcurrentFontFamily"
Grid.Row="15"
Grid.Row="16"
Grid.Column="1"
Width="200"
Margin="{StaticResource SettingItemMargin}"
MaxDropDownHeight="1000"
Style="{StaticResource DefComboBox}" />
<TextBlock
Grid.Row="15"
Grid.Row="16"
Grid.Column="2"
Margin="{StaticResource ServerItemMargin}"
VerticalAlignment="Center"
@ -694,7 +709,7 @@
TextWrapping="Wrap" />
<TextBlock
Grid.Row="16"
Grid.Row="17"
Grid.Column="0"
Margin="{StaticResource SettingItemMargin}"
VerticalAlignment="Center"
@ -702,14 +717,14 @@
Text="{x:Static resx:ResUI.TbSettingsSpeedTestTimeout}" />
<ComboBox
x:Name="cmbSpeedTestTimeout"
Grid.Row="16"
Grid.Row="17"
Grid.Column="1"
Width="200"
Margin="{StaticResource SettingItemMargin}"
Style="{StaticResource DefComboBox}" />
<TextBlock
Grid.Row="17"
Grid.Row="18"
Grid.Column="0"
Margin="{StaticResource SettingItemMargin}"
VerticalAlignment="Center"
@ -717,7 +732,7 @@
Text="{x:Static resx:ResUI.TbSettingsSpeedTestUrl}" />
<ComboBox
x:Name="cmbSpeedTestUrl"
Grid.Row="17"
Grid.Row="18"
Grid.Column="1"
Width="300"
Margin="{StaticResource SettingItemMargin}"
@ -725,21 +740,23 @@
Style="{StaticResource DefComboBox}" />
<TextBlock
Grid.Row="18"
Grid.Row="19"
Grid.Column="0"
Margin="{StaticResource SettingItemMargin}"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsEnableHWA}" />
<ToggleButton
x:Name="togEnableHWA"
Grid.Row="18"
Text="{x:Static resx:ResUI.TbSettingsSpeedPingTestUrl}" />
<ComboBox
x:Name="cmbSpeedPingTestUrl"
Grid.Row="19"
Grid.Column="1"
Width="300"
Margin="{StaticResource SettingItemMargin}"
HorizontalAlignment="Left" />
IsEditable="True"
Style="{StaticResource DefComboBox}" />
<TextBlock
Grid.Row="19"
Grid.Row="20"
Grid.Column="0"
Margin="{StaticResource SettingItemMargin}"
VerticalAlignment="Center"
@ -747,7 +764,7 @@
Text="{x:Static resx:ResUI.TbSettingsSubConvert}" />
<ComboBox
x:Name="cmbSubConvertUrl"
Grid.Row="19"
Grid.Row="20"
Grid.Column="1"
Width="300"
Margin="{StaticResource SettingItemMargin}"

View File

@ -80,6 +80,10 @@ namespace v2rayN.Views
{
cmbSpeedTestUrl.Items.Add(it);
});
Global.SpeedPingTestUrls.ForEach(it =>
{
cmbSpeedPingTestUrl.Items.Add(it);
});
Global.SubConvertUrls.ForEach(it =>
{
cmbSubConvertUrl.Items.Add(it);
@ -176,6 +180,7 @@ namespace v2rayN.Views
this.Bind(ViewModel, vm => vm.currentFontFamily, v => v.cmbcurrentFontFamily.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SpeedTestTimeout, v => v.cmbSpeedTestTimeout.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SpeedTestUrl, v => v.cmbSpeedTestUrl.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SpeedPingTestUrl, v => v.cmbSpeedPingTestUrl.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.EnableHWA, v => v.togEnableHWA.IsChecked).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SubConvertUrl, v => v.cmbSubConvertUrl.Text).DisposeWith(disposables);