add edit server menu

pull/3165/head
2dust 2 years ago
parent b147e05794
commit fcbc9471aa

@ -1,4 +1,5 @@
using Grpc.Core;
using ProtosLib.Statistics;
using System.Net;
using System.Net.Sockets;
using v2rayN.Base;

@ -681,6 +681,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 Edit Server (Ctrl+D) 的本地化字符串。
/// </summary>
public static string menuEditServer {
get {
return ResourceManager.GetString("menuEditServer", resourceCulture);
}
}
/// <summary>
/// 查找类似 Exit 的本地化字符串。
/// </summary>
@ -1114,7 +1123,7 @@ namespace v2rayN.Resx {
}
/// <summary>
/// 查找类似 Share Server (Ctrl+D) 的本地化字符串。
/// 查找类似 Share Server (Ctrl+F) 的本地化字符串。
/// </summary>
public static string menuShareServer {
get {

@ -899,7 +899,7 @@
<value>حالت Pac</value>
</data>
<data name="menuShareServer" xml:space="preserve">
<value>اشتراک گذاری سرور(Ctrl+D)</value>
<value>اشتراک گذاری سرور(Ctrl+F)</value>
</data>
<data name="menuRouting" xml:space="preserve">
<value>مسیریابی</value>

@ -899,7 +899,7 @@
<value>Pac Mode</value>
</data>
<data name="menuShareServer" xml:space="preserve">
<value>Share Server (Ctrl+D)</value>
<value>Share Server (Ctrl+F)</value>
</data>
<data name="menuRouting" xml:space="preserve">
<value>Routing</value>
@ -1075,4 +1075,7 @@
<data name="SpeedtestingSkip" xml:space="preserve">
<value>Skip test</value>
</data>
<data name="menuEditServer" xml:space="preserve">
<value>Edit Server (Ctrl+D)</value>
</data>
</root>

@ -899,7 +899,7 @@
<value>Pac模式</value>
</data>
<data name="menuShareServer" xml:space="preserve">
<value>分享服务器 (Ctrl+D)</value>
<value>分享服务器 (Ctrl+F)</value>
</data>
<data name="menuRouting" xml:space="preserve">
<value>路由</value>
@ -1075,4 +1075,7 @@
<data name="SpeedtestingSkip" xml:space="preserve">
<value>跳过测试</value>
</data>
<data name="menuEditServer" xml:space="preserve">
<value>编辑服务器 (Ctrl+D)</value>
</data>
</root>

@ -84,6 +84,7 @@ namespace v2rayN.ViewModels
public ReactiveCommand<Unit, Unit> AddServerViaClipboardCmd { get; }
public ReactiveCommand<Unit, Unit> AddServerViaScanCmd { get; }
//servers delete
public ReactiveCommand<Unit, Unit> EditServerCmd { get; }
public ReactiveCommand<Unit, Unit> RemoveServerCmd { get; }
public ReactiveCommand<Unit, Unit> RemoveDuplicateServerCmd { get; }
public ReactiveCommand<Unit, Unit> CopyServerCmd { get; }
@ -293,6 +294,10 @@ namespace v2rayN.ViewModels
return ScanScreenTaskAsync();
});
//servers delete
EditServerCmd = ReactiveCommand.Create(() =>
{
EditServer(false, EConfigType.Custom);
}, canEditRemove);
RemoveServerCmd = ReactiveCommand.Create(() =>
{
RemoveServer();

@ -433,6 +433,10 @@
</DataGrid.InputBindings>
<DataGrid.ContextMenu>
<ContextMenu Style="{StaticResource DefContextMenu}">
<MenuItem
x:Name="menuEditServer"
Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuEditServer}" />
<MenuItem
x:Name="menuSetDefaultServer"
Height="{StaticResource MenuItemHeight}"
@ -454,6 +458,31 @@
Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuShareServer}" />
<Separator />
<MenuItem
x:Name="menuMixedTestServer"
Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuMixedTestServer}" />
<MenuItem
x:Name="menuPingServer"
Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuPingServer}" />
<MenuItem
x:Name="menuTcpingServer"
Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuTcpingServer}" />
<MenuItem
x:Name="menuRealPingServer"
Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuRealPingServer}" />
<MenuItem
x:Name="menuSpeedServer"
Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuSpeedServer}" />
<MenuItem
x:Name="menuSortServerResult"
Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuSortServerResult}" />
<Separator />
<MenuItem
x:Name="menuMoveToGroup"
Height="{StaticResource MenuItemHeight}"
@ -493,31 +522,6 @@
Click="menuSelectAll_Click"
Header="{x:Static resx:ResUI.menuSelectAll}" />
<Separator />
<MenuItem
x:Name="menuMixedTestServer"
Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuMixedTestServer}" />
<MenuItem
x:Name="menuPingServer"
Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuPingServer}" />
<MenuItem
x:Name="menuTcpingServer"
Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuTcpingServer}" />
<MenuItem
x:Name="menuRealPingServer"
Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuRealPingServer}" />
<MenuItem
x:Name="menuSpeedServer"
Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuSpeedServer}" />
<MenuItem
x:Name="menuSortServerResult"
Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuSortServerResult}" />
<Separator />
<MenuItem
x:Name="menuExport2ClientConfig"
Height="{StaticResource MenuItemHeight}"

@ -71,6 +71,7 @@ namespace v2rayN.Views
this.BindCommand(ViewModel, vm => vm.AddServerViaScanCmd, v => v.menuAddServerViaScan).DisposeWith(disposables);
//servers delete
this.BindCommand(ViewModel, vm => vm.EditServerCmd, v => v.menuEditServer).DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.RemoveServerCmd, v => v.menuRemoveServer).DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.RemoveDuplicateServerCmd, v => v.menuRemoveDuplicateServer).DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.CopyServerCmd, v => v.menuCopyServer).DisposeWith(disposables);
@ -323,6 +324,10 @@ namespace v2rayN.Views
ViewModel?.Export2ShareUrl();
}
else if (e.Key == Key.D)
{
ViewModel?.EditServer(false, EConfigType.Custom);
}
else if (e.Key == Key.F)
{
ViewModel?.ShareServer();
}

Loading…
Cancel
Save