清理速度测试结果, 清理延迟测试结果

This commit is contained in:
crazypeace 2023-10-11 05:34:57 +08:00
parent 2652beed88
commit e23ae91347
8 changed files with 60 additions and 1 deletions

View file

@ -54,11 +54,13 @@ namespace v2rayN.Handler
case ESpeedActionType.Ping: case ESpeedActionType.Ping:
case ESpeedActionType.Tcping: case ESpeedActionType.Tcping:
case ESpeedActionType.Realping: case ESpeedActionType.Realping:
case ESpeedActionType.ClearDelay:
UpdateFunc(it.indexId, ResUI.Speedtesting, ""); UpdateFunc(it.indexId, ResUI.Speedtesting, "");
ProfileExHandler.Instance.SetTestDelay(it.indexId, "0"); ProfileExHandler.Instance.SetTestDelay(it.indexId, "0");
break; break;
case ESpeedActionType.Speedtest: case ESpeedActionType.Speedtest:
case ESpeedActionType.ClearSpeed:
UpdateFunc(it.indexId, "", ResUI.SpeedtestingWait); UpdateFunc(it.indexId, "", ResUI.SpeedtestingWait);
ProfileExHandler.Instance.SetTestSpeed(it.indexId, "0"); ProfileExHandler.Instance.SetTestSpeed(it.indexId, "0");
break; break;

View file

@ -6,6 +6,8 @@
Tcping, Tcping,
Realping, Realping,
Speedtest, Speedtest,
Mixedtest Mixedtest,
ClearDelay,
ClearSpeed
} }
} }

View file

@ -663,6 +663,15 @@ namespace v2rayN.Resx {
} }
} }
/// <summary>
/// 查找类似 Clear Delay Result 的本地化字符串。
/// </summary>
public static string menuClearDelayResult {
get {
return ResourceManager.GetString("menuClearDelayResult", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 Clear all service statistics 的本地化字符串。 /// 查找类似 Clear all service statistics 的本地化字符串。
/// </summary> /// </summary>
@ -672,6 +681,15 @@ namespace v2rayN.Resx {
} }
} }
/// <summary>
/// 查找类似 Clear Speed Result 的本地化字符串。
/// </summary>
public static string menuClearSpeedResult {
get {
return ResourceManager.GetString("menuClearSpeedResult", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 Close 的本地化字符串。 /// 查找类似 Close 的本地化字符串。
/// </summary> /// </summary>

View file

@ -1138,4 +1138,10 @@
<data name="TbRoutingRuleDomain" xml:space="preserve"> <data name="TbRoutingRuleDomain" xml:space="preserve">
<value>Domain</value> <value>Domain</value>
</data> </data>
<data name="menuClearDelayResult" xml:space="preserve">
<value>Clear Delay Result</value>
</data>
<data name="menuClearSpeedResult" xml:space="preserve">
<value>Clear Speed Result</value>
</data>
</root> </root>

View file

@ -1135,4 +1135,10 @@
<data name="TbRoutingRuleIP" xml:space="preserve"> <data name="TbRoutingRuleIP" xml:space="preserve">
<value>IP 或 IP CIDR</value> <value>IP 或 IP CIDR</value>
</data> </data>
<data name="menuClearDelayResult" xml:space="preserve">
<value>清除延时测试结果</value>
</data>
<data name="menuClearSpeedResult" xml:space="preserve">
<value>清除速度测试结果</value>
</data>
</root> </root>

View file

@ -118,6 +118,10 @@ namespace v2rayN.ViewModels
public ReactiveCommand<Unit, Unit> SpeedServerCmd { get; } public ReactiveCommand<Unit, Unit> SpeedServerCmd { get; }
public ReactiveCommand<Unit, Unit> SortServerResultCmd { get; } public ReactiveCommand<Unit, Unit> SortServerResultCmd { get; }
// clear server test result
public ReactiveCommand<Unit, Unit> ClearDelayResultCmd { get; }
public ReactiveCommand<Unit, Unit> ClearSpeedResultCmd { get; }
//servers export //servers export
public ReactiveCommand<Unit, Unit> Export2ClientConfigCmd { get; } public ReactiveCommand<Unit, Unit> Export2ClientConfigCmd { get; }
@ -417,6 +421,15 @@ namespace v2rayN.ViewModels
{ {
SortServer(EServerColName.delayVal.ToString()); SortServer(EServerColName.delayVal.ToString());
}); });
//clear server test result
ClearDelayResultCmd = ReactiveCommand.Create(() =>
{
ServerSpeedtest(ESpeedActionType.ClearDelay);
}, canEditRemove);
ClearSpeedResultCmd = ReactiveCommand.Create(() =>
{
ServerSpeedtest(ESpeedActionType.ClearSpeed);
}, canEditRemove);
//servers export //servers export
Export2ClientConfigCmd = ReactiveCommand.Create(() => Export2ClientConfigCmd = ReactiveCommand.Create(() =>
{ {

View file

@ -577,6 +577,14 @@
x:Name="menuSortServerResult" x:Name="menuSortServerResult"
Height="{StaticResource MenuItemHeight}" Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuSortServerResult}" /> Header="{x:Static resx:ResUI.menuSortServerResult}" />
<MenuItem
x:Name="menuClearDelayResult"
Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuClearDelayResult}" />
<MenuItem
x:Name="menuClearSpeedResult"
Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuClearSpeedResult}" />
<Separator /> <Separator />
<MenuItem <MenuItem
x:Name="menuMoveToGroup" x:Name="menuMoveToGroup"

View file

@ -115,6 +115,10 @@ namespace v2rayN.Views
this.BindCommand(ViewModel, vm => vm.SpeedServerCmd, v => v.menuSpeedServer).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.SpeedServerCmd, v => v.menuSpeedServer).DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.SortServerResultCmd, v => v.menuSortServerResult).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.SortServerResultCmd, v => v.menuSortServerResult).DisposeWith(disposables);
// clear server test result
this.BindCommand(ViewModel, vm => vm.ClearDelayResultCmd, v => v.menuClearDelayResult).DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.ClearSpeedResultCmd, v => v.menuClearSpeedResult).DisposeWith(disposables);
//servers export //servers export
this.BindCommand(ViewModel, vm => vm.Export2ClientConfigCmd, v => v.menuExport2ClientConfig).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.Export2ClientConfigCmd, v => v.menuExport2ClientConfig).DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.Export2ShareUrlCmd, v => v.menuExport2ShareUrl).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.Export2ShareUrlCmd, v => v.menuExport2ShareUrl).DisposeWith(disposables);