Optimize speed test info

pull/3165/head
2dust 2023-01-31 14:05:31 +08:00
parent 8ba05cb4ed
commit 47e6eb546d
5 changed files with 40 additions and 5 deletions

View File

@ -30,6 +30,10 @@ namespace v2rayN.Handler
_selecteds = new List<ServerTestItem>();
foreach (var it in selecteds)
{
if (it.configType == EConfigType.Custom)
{
continue;
}
_selecteds.Add(new ServerTestItem()
{
indexId = it.indexId,
@ -38,6 +42,25 @@ namespace v2rayN.Handler
configType = it.configType
});
}
//clear test result
foreach (var it in _selecteds)
{
switch (actionType)
{
case ESpeedActionType.Ping:
case ESpeedActionType.Tcping:
case ESpeedActionType.Realping:
UpdateFunc(it.indexId, ResUI.Speedtesting, "");
break;
case ESpeedActionType.Speedtest:
UpdateFunc(it.indexId, "", ResUI.Speedtesting);
break;
case ESpeedActionType.Mixedtest:
UpdateFunc(it.indexId, ResUI.Speedtesting, ResUI.Speedtesting);
break;
}
}
switch (actionType)
{
case ESpeedActionType.Ping:
@ -199,11 +222,11 @@ namespace v2rayN.Handler
continue;
}
if (it.delay < 0)
{
{
UpdateFunc(it.indexId, "", ResUI.SpeedtestingSkip);
continue;
}
_ = LazyConfig.Instance.SetTestResult(it.indexId, "", "-1");
UpdateFunc(it.indexId, "", ResUI.Speedtesting);
var item = LazyConfig.Instance.GetProfileItem(it.indexId);
if (item is null) continue;

View File

@ -1752,6 +1752,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 Skip test 的本地化字符串。
/// </summary>
public static string SpeedtestingSkip {
get {
return ResourceManager.GetString("SpeedtestingSkip", resourceCulture);
}
}
/// <summary>
/// 查找类似 PAC failed to start. Please run this program as Administrator. 的本地化字符串。
/// </summary>

View File

@ -1072,4 +1072,7 @@
<data name="TbAutoRefresh" xml:space="preserve">
<value>AutoRefresh</value>
</data>
<data name="SpeedtestingSkip" xml:space="preserve">
<value>Skip test</value>
</data>
</root>

View File

@ -1072,4 +1072,7 @@
<data name="TbAutoRefresh" xml:space="preserve">
<value>自动刷新</value>
</data>
<data name="SpeedtestingSkip" xml:space="preserve">
<value>跳过测试</value>
</data>
</root>

View File

@ -105,9 +105,6 @@
<None Update="Resources\Fonts\SourceHanSansCN-Regular.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Resources\Fonts\微软雅黑-Regular.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>