mirror of
https://github.com/2dust/v2rayN.git
synced 2025-10-13 20:09:12 +00:00
Try add GUI support
This commit is contained in:
parent
8f00d69e9d
commit
59e7a5cdb9
15 changed files with 607 additions and 5 deletions
|
@ -290,6 +290,26 @@ public class Global
|
|||
"tuic"
|
||||
];
|
||||
|
||||
public static readonly List<string> NaiveProxyCoreTypes =
|
||||
[
|
||||
"naiveproxy"
|
||||
];
|
||||
|
||||
public static readonly List<string> JuicityProxyCoreTypes =
|
||||
[
|
||||
"juicity"
|
||||
];
|
||||
|
||||
public static readonly List<string> BrookCoreTypes =
|
||||
[
|
||||
"brook"
|
||||
];
|
||||
|
||||
public static readonly List<string> ShadowquicCoreTypes =
|
||||
[
|
||||
"shadowquic"
|
||||
];
|
||||
|
||||
public static readonly List<EConfigType> SupportSplitConfigTypes =
|
||||
[
|
||||
EConfigType.VMess,
|
||||
|
@ -488,13 +508,20 @@ public class Global
|
|||
""
|
||||
];
|
||||
|
||||
public static readonly List<string> TuicCongestionControls =
|
||||
public static readonly List<string> CongestionControls =
|
||||
[
|
||||
"cubic",
|
||||
"new_reno",
|
||||
"bbr"
|
||||
];
|
||||
|
||||
public static readonly List<string> NaiveProxyProtocols =
|
||||
[
|
||||
"https",
|
||||
"http",
|
||||
"quic"
|
||||
];
|
||||
|
||||
public static readonly List<string> allowSelectType =
|
||||
[
|
||||
"selector",
|
||||
|
|
|
@ -270,6 +270,10 @@ public class ConfigHandler
|
|||
EConfigType.TUIC => await AddTuicServer(config, item),
|
||||
EConfigType.WireGuard => await AddWireguardServer(config, item),
|
||||
EConfigType.Anytls => await AddAnytlsServer(config, item),
|
||||
EConfigType.NaiveProxy => await AddNaiveServer(config, item),
|
||||
EConfigType.Juicity => await AddJuicityServer(config, item),
|
||||
EConfigType.Brook => await AddBrookServer(config, item),
|
||||
EConfigType.Shadowquic => await AddShadowquicServer(config, item),
|
||||
_ => -1,
|
||||
};
|
||||
return ret;
|
||||
|
@ -738,9 +742,9 @@ public class ConfigHandler
|
|||
profileItem.Security = profileItem.Security.TrimEx();
|
||||
profileItem.Network = string.Empty;
|
||||
|
||||
if (!Global.TuicCongestionControls.Contains(profileItem.HeaderType))
|
||||
if (!Global.CongestionControls.Contains(profileItem.HeaderType))
|
||||
{
|
||||
profileItem.HeaderType = Global.TuicCongestionControls.FirstOrDefault()!;
|
||||
profileItem.HeaderType = Global.CongestionControls.FirstOrDefault()!;
|
||||
}
|
||||
|
||||
if (profileItem.StreamSecurity.IsNullOrEmpty())
|
||||
|
@ -823,6 +827,140 @@ public class ConfigHandler
|
|||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add or edit a Naive server
|
||||
/// Validates and processes Naive-specific settings
|
||||
/// </summary>
|
||||
/// <param name="config">Current configuration</param>
|
||||
/// <param name="profileItem">Naive profile to add</param>
|
||||
/// <param name="toFile">Whether to save to file</param>
|
||||
/// <returns>0 if successful, -1 if failed</returns>
|
||||
public static async Task<int> AddNaiveServer(Config config, ProfileItem profileItem, bool toFile = true)
|
||||
{
|
||||
profileItem.ConfigType = EConfigType.NaiveProxy;
|
||||
profileItem.CoreType = ECoreType.naiveproxy;
|
||||
|
||||
profileItem.Address = profileItem.Address.TrimEx();
|
||||
profileItem.Id = profileItem.Id.TrimEx();
|
||||
profileItem.Network = string.Empty;
|
||||
if (profileItem.StreamSecurity.IsNullOrEmpty())
|
||||
{
|
||||
profileItem.StreamSecurity = Global.StreamSecurity;
|
||||
}
|
||||
if (profileItem.Id.IsNullOrEmpty())
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
await AddServerCommon(config, profileItem, toFile);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add or edit a Juicity server
|
||||
/// Validates and processes Juicity-specific settings
|
||||
/// </summary>
|
||||
/// <param name="config">Current configuration</param>
|
||||
/// <param name="profileItem">Juicity profile to add</param>
|
||||
/// <param name="toFile">Whether to save to file</param>
|
||||
/// <returns>0 if successful, -1 if failed</returns>
|
||||
public static async Task<int> AddJuicityServer(Config config, ProfileItem profileItem, bool toFile = true)
|
||||
{
|
||||
profileItem.ConfigType = EConfigType.Juicity;
|
||||
profileItem.CoreType = ECoreType.juicity;
|
||||
|
||||
profileItem.Address = profileItem.Address.TrimEx();
|
||||
profileItem.Id = profileItem.Id.TrimEx();
|
||||
profileItem.Security = profileItem.Security.TrimEx();
|
||||
profileItem.Network = string.Empty;
|
||||
|
||||
if (!Global.CongestionControls.Contains(profileItem.HeaderType))
|
||||
{
|
||||
profileItem.HeaderType = Global.CongestionControls.FirstOrDefault()!;
|
||||
}
|
||||
|
||||
if (profileItem.StreamSecurity.IsNullOrEmpty())
|
||||
{
|
||||
profileItem.StreamSecurity = Global.StreamSecurity;
|
||||
}
|
||||
if (profileItem.Alpn.IsNullOrEmpty())
|
||||
{
|
||||
profileItem.Alpn = "h3";
|
||||
}
|
||||
if (profileItem.Id.IsNullOrEmpty())
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
await AddServerCommon(config, profileItem, toFile);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add or edit a Brook server
|
||||
/// Validates and processes Brook-specific settings
|
||||
/// </summary>
|
||||
/// <param name="config">Current configuration</param>
|
||||
/// <param name="profileItem">Brook profile to add</param>
|
||||
/// <param name="toFile">Whether to save to file</param>
|
||||
/// <returns>0 if successful, -1 if failed</returns>
|
||||
public static async Task<int> AddBrookServer(Config config, ProfileItem profileItem, bool toFile = true)
|
||||
{
|
||||
profileItem.ConfigType = EConfigType.Brook;
|
||||
profileItem.CoreType = ECoreType.brook;
|
||||
|
||||
profileItem.Address = profileItem.Address.TrimEx();
|
||||
profileItem.Id = profileItem.Id.TrimEx();
|
||||
profileItem.Network = string.Empty;
|
||||
if (profileItem.Id.IsNullOrEmpty())
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
await AddServerCommon(config, profileItem, toFile);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add or edit a Shadowquic server
|
||||
/// Validates and processes Shadowquic-specific settings
|
||||
/// </summary>
|
||||
/// <param name="config">Current configuration</param>
|
||||
/// <param name="profileItem">Shadowquic profile to add</param>
|
||||
/// <param name="toFile">Whether to save to file</param>
|
||||
/// <returns>0 if successful, -1 if failed</returns>
|
||||
public static async Task<int> AddShadowquicServer(Config config, ProfileItem profileItem, bool toFile = true)
|
||||
{
|
||||
profileItem.ConfigType = EConfigType.Shadowquic;
|
||||
profileItem.CoreType = ECoreType.shadowquic;
|
||||
|
||||
profileItem.Address = profileItem.Address.TrimEx();
|
||||
profileItem.Id = profileItem.Id.TrimEx();
|
||||
profileItem.Security = profileItem.Security.TrimEx();
|
||||
profileItem.Network = string.Empty;
|
||||
|
||||
if (!Global.CongestionControls.Contains(profileItem.HeaderType))
|
||||
{
|
||||
profileItem.HeaderType = Global.CongestionControls.FirstOrDefault()!;
|
||||
}
|
||||
|
||||
if (profileItem.StreamSecurity.IsNullOrEmpty())
|
||||
{
|
||||
profileItem.StreamSecurity = Global.StreamSecurity;
|
||||
}
|
||||
if (profileItem.Alpn.IsNullOrEmpty())
|
||||
{
|
||||
profileItem.Alpn = "h3";
|
||||
}
|
||||
if (profileItem.Id.IsNullOrEmpty())
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
await AddServerCommon(config, profileItem, toFile);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sort the server list by the specified column
|
||||
/// Updates the sort order in the profile extension data
|
||||
|
@ -1296,6 +1434,10 @@ public class ConfigHandler
|
|||
EConfigType.TUIC => await AddTuicServer(config, profileItem, false),
|
||||
EConfigType.WireGuard => await AddWireguardServer(config, profileItem, false),
|
||||
EConfigType.Anytls => await AddAnytlsServer(config, profileItem, false),
|
||||
EConfigType.NaiveProxy => await AddNaiveServer(config, profileItem, false),
|
||||
EConfigType.Juicity => await AddJuicityServer(config, profileItem, false),
|
||||
EConfigType.Brook => await AddBrookServer(config, profileItem, false),
|
||||
EConfigType.Shadowquic => await AddShadowquicServer(config, profileItem, false),
|
||||
_ => -1,
|
||||
};
|
||||
|
||||
|
|
45
v2rayN/ServiceLib/Resx/ResUI.Designer.cs
generated
45
v2rayN/ServiceLib/Resx/ResUI.Designer.cs
generated
|
@ -663,6 +663,15 @@ namespace ServiceLib.Resx {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Add [Brook] Configuration 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string menuAddBrookServer {
|
||||
get {
|
||||
return ResourceManager.GetString("menuAddBrookServer", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Add a custom configuration Configuration 的本地化字符串。
|
||||
/// </summary>
|
||||
|
@ -690,6 +699,24 @@ namespace ServiceLib.Resx {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Add [Juicity] Configuration 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string menuAddJuicityServer {
|
||||
get {
|
||||
return ResourceManager.GetString("menuAddJuicityServer", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Add [Naive] Configuration 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string menuAddNaiveServer {
|
||||
get {
|
||||
return ResourceManager.GetString("menuAddNaiveServer", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Import Share Links from clipboard (Ctrl+V) 的本地化字符串。
|
||||
/// </summary>
|
||||
|
@ -717,6 +744,15 @@ namespace ServiceLib.Resx {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Add [Shadowquic] Configuration 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string menuAddShadowquicServer {
|
||||
get {
|
||||
return ResourceManager.GetString("menuAddShadowquicServer", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Add [Shadowsocks] Configuration 的本地化字符串。
|
||||
/// </summary>
|
||||
|
@ -2472,6 +2508,15 @@ namespace ServiceLib.Resx {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Proxy Protocol 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string TbHeaderType100 {
|
||||
get {
|
||||
return ResourceManager.GetString("TbHeaderType100", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Congestion control 的本地化字符串。
|
||||
/// </summary>
|
||||
|
|
|
@ -1413,4 +1413,19 @@
|
|||
<data name="TbSettingsSplitCoreDoc2" xml:space="preserve">
|
||||
<value>Routing Core defaults to sing-box when Tun is enabled.</value>
|
||||
</data>
|
||||
<data name="menuAddBrookServer" xml:space="preserve">
|
||||
<value>افزودن سرور [Brook]</value>
|
||||
</data>
|
||||
<data name="menuAddJuicityServer" xml:space="preserve">
|
||||
<value>افزودن سرور [Juicity]</value>
|
||||
</data>
|
||||
<data name="menuAddNaiveServer" xml:space="preserve">
|
||||
<value>افزودن سرور [Naive]</value>
|
||||
</data>
|
||||
<data name="menuAddShadowquicServer" xml:space="preserve">
|
||||
<value>افزودن سرور [Shadowquic]</value>
|
||||
</data>
|
||||
<data name="TbHeaderType100" xml:space="preserve">
|
||||
<value>Proxy Protocol</value>
|
||||
</data>
|
||||
</root>
|
|
@ -1413,4 +1413,19 @@
|
|||
<data name="TbSettingsSplitCoreDoc2" xml:space="preserve">
|
||||
<value>Routing Core defaults to sing-box when Tun is enabled.</value>
|
||||
</data>
|
||||
<data name="menuAddBrookServer" xml:space="preserve">
|
||||
<value>[Brook] szerver hozzáadása</value>
|
||||
</data>
|
||||
<data name="menuAddJuicityServer" xml:space="preserve">
|
||||
<value>[Juicity] szerver hozzáadása</value>
|
||||
</data>
|
||||
<data name="menuAddNaiveServer" xml:space="preserve">
|
||||
<value>[Naive] szerver hozzáadása</value>
|
||||
</data>
|
||||
<data name="menuAddShadowquicServer" xml:space="preserve">
|
||||
<value>[Shadowquic] szerver hozzáadása</value>
|
||||
</data>
|
||||
<data name="TbHeaderType100" xml:space="preserve">
|
||||
<value>Proxy Protocol</value>
|
||||
</data>
|
||||
</root>
|
|
@ -1413,4 +1413,19 @@
|
|||
<data name="TbSettingsSplitCoreDoc2" xml:space="preserve">
|
||||
<value>Routing Core defaults to sing-box when Tun is enabled.</value>
|
||||
</data>
|
||||
<data name="menuAddBrookServer" xml:space="preserve">
|
||||
<value>Add [Brook] Configuration</value>
|
||||
</data>
|
||||
<data name="menuAddJuicityServer" xml:space="preserve">
|
||||
<value>Add [Juicity] Configuration</value>
|
||||
</data>
|
||||
<data name="menuAddNaiveServer" xml:space="preserve">
|
||||
<value>Add [Naive] Configuration</value>
|
||||
</data>
|
||||
<data name="menuAddShadowquicServer" xml:space="preserve">
|
||||
<value>Add [Shadowquic] Configuration</value>
|
||||
</data>
|
||||
<data name="TbHeaderType100" xml:space="preserve">
|
||||
<value>Proxy Protocol</value>
|
||||
</data>
|
||||
</root>
|
|
@ -1413,4 +1413,19 @@
|
|||
<data name="TbSettingsSplitCoreDoc2" xml:space="preserve">
|
||||
<value>Routing Core defaults to sing-box when Tun is enabled.</value>
|
||||
</data>
|
||||
<data name="menuAddBrookServer" xml:space="preserve">
|
||||
<value>Добавить сервер [Brook]</value>
|
||||
</data>
|
||||
<data name="menuAddJuicityServer" xml:space="preserve">
|
||||
<value>Добавить сервер [Juicity]</value>
|
||||
</data>
|
||||
<data name="menuAddNaiveServer" xml:space="preserve">
|
||||
<value>Добавить сервер [Naive]</value>
|
||||
</data>
|
||||
<data name="menuAddShadowquicServer" xml:space="preserve">
|
||||
<value>Добавить сервер [Shadowquic]</value>
|
||||
</data>
|
||||
<data name="TbHeaderType100" xml:space="preserve">
|
||||
<value>Proxy Protocol</value>
|
||||
</data>
|
||||
</root>
|
|
@ -1410,4 +1410,19 @@
|
|||
<data name="TbSettingsSplitCoreDoc2" xml:space="preserve">
|
||||
<value>启用 Tun 时,路由 Core 为 sing-box</value>
|
||||
</data>
|
||||
<data name="menuAddBrookServer" xml:space="preserve">
|
||||
<value>添加 [Brook] 配置文件</value>
|
||||
</data>
|
||||
<data name="menuAddJuicityServer" xml:space="preserve">
|
||||
<value>添加 [Juicity] 配置文件</value>
|
||||
</data>
|
||||
<data name="menuAddNaiveServer" xml:space="preserve">
|
||||
<value>添加 [Naive] 配置文件</value>
|
||||
</data>
|
||||
<data name="menuAddShadowquicServer" xml:space="preserve">
|
||||
<value>添加 [Shadowquic] 配置文件</value>
|
||||
</data>
|
||||
<data name="TbHeaderType100" xml:space="preserve">
|
||||
<value>代理协议</value>
|
||||
</data>
|
||||
</root>
|
|
@ -1410,4 +1410,19 @@
|
|||
<data name="TbSettingsSplitCoreDoc2" xml:space="preserve">
|
||||
<value>Routing Core defaults to sing-box when Tun is enabled.</value>
|
||||
</data>
|
||||
<data name="menuAddBrookServer" xml:space="preserve">
|
||||
<value>新增 [Brook] 設定檔</value>
|
||||
</data>
|
||||
<data name="menuAddJuicityServer" xml:space="preserve">
|
||||
<value>新增 [Juicity] 設定檔</value>
|
||||
</data>
|
||||
<data name="menuAddNaiveServer" xml:space="preserve">
|
||||
<value>新增 [Naive] 設定檔</value>
|
||||
</data>
|
||||
<data name="menuAddShadowquicServer" xml:space="preserve">
|
||||
<value>新增 [Shadowquic] 設定檔</value>
|
||||
</data>
|
||||
<data name="TbHeaderType100" xml:space="preserve">
|
||||
<value>Proxy Protocol</value>
|
||||
</data>
|
||||
</root>
|
|
@ -25,6 +25,10 @@ public class MainWindowViewModel : MyReactiveObject
|
|||
public ReactiveCommand<Unit, Unit> AddServerViaClipboardCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddServerViaScanCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddServerViaImageCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddBrookServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddJuicityServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddNaiveServerCmd { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddShadowquicServerCmd { get; }
|
||||
|
||||
//Subscription
|
||||
public ReactiveCommand<Unit, Unit> SubSettingCmd { get; }
|
||||
|
@ -116,6 +120,22 @@ public class MainWindowViewModel : MyReactiveObject
|
|||
{
|
||||
await AddServerAsync(true, EConfigType.Anytls);
|
||||
});
|
||||
AddBrookServerCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||
{
|
||||
await AddServerAsync(true, EConfigType.Brook);
|
||||
});
|
||||
AddJuicityServerCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||
{
|
||||
await AddServerAsync(true, EConfigType.Juicity);
|
||||
});
|
||||
AddNaiveServerCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||
{
|
||||
await AddServerAsync(true, EConfigType.NaiveProxy);
|
||||
});
|
||||
AddShadowquicServerCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||
{
|
||||
await AddServerAsync(true, EConfigType.Shadowquic);
|
||||
});
|
||||
AddCustomServerCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||
{
|
||||
await AddServerAsync(true, EConfigType.Custom);
|
||||
|
|
|
@ -91,7 +91,7 @@ public partial class AddServerWindow : WindowBase<AddServerViewModel>
|
|||
cmbFingerprint.IsEnabled = false;
|
||||
cmbFingerprint.SelectedValue = string.Empty;
|
||||
|
||||
cmbHeaderType8.ItemsSource = Global.TuicCongestionControls;
|
||||
cmbHeaderType8.ItemsSource = Global.CongestionControls;
|
||||
break;
|
||||
|
||||
case EConfigType.WireGuard:
|
||||
|
|
|
@ -736,6 +736,199 @@
|
|||
Margin="{StaticResource Margin4}"
|
||||
Style="{StaticResource DefTextBox}" />
|
||||
</Grid>
|
||||
<Grid
|
||||
x:Name="gridNaive"
|
||||
Grid.Row="2"
|
||||
Visibility="Hidden">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="180" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource Margin4}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbId3}" />
|
||||
<TextBox
|
||||
x:Name="txtId100"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="400"
|
||||
Margin="{StaticResource Margin4}"
|
||||
Style="{StaticResource DefTextBox}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource Margin4}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbHeaderType100}" />
|
||||
<ComboBox
|
||||
x:Name="cmbHeaderType100"
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Width="200"
|
||||
Margin="{StaticResource Margin4}"
|
||||
Style="{StaticResource DefComboBox}" />
|
||||
</Grid>
|
||||
<Grid
|
||||
x:Name="gridJuicity"
|
||||
Grid.Row="2"
|
||||
Visibility="Hidden">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="180" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource Margin4}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbId}" />
|
||||
<TextBox
|
||||
x:Name="txtId101"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="400"
|
||||
Margin="{StaticResource Margin4}"
|
||||
Style="{StaticResource DefTextBox}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource Margin4}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbId3}" />
|
||||
<TextBox
|
||||
x:Name="txtSecurity101"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Width="400"
|
||||
Margin="{StaticResource Margin4}"
|
||||
Style="{StaticResource DefTextBox}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource Margin4}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbHeaderType8}" />
|
||||
<ComboBox
|
||||
x:Name="cmbHeaderType101"
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Width="200"
|
||||
Margin="{StaticResource Margin4}"
|
||||
Style="{StaticResource DefComboBox}" />
|
||||
</Grid>
|
||||
<Grid
|
||||
x:Name="gridBrook"
|
||||
Grid.Row="2"
|
||||
Visibility="Hidden">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="180" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource Margin4}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbId3}" />
|
||||
<TextBox
|
||||
x:Name="txtId102"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="400"
|
||||
Margin="{StaticResource Margin4}"
|
||||
Style="{StaticResource DefTextBox}" />
|
||||
</Grid>
|
||||
<Grid
|
||||
x:Name="gridShadowquic"
|
||||
Grid.Row="2"
|
||||
Visibility="Hidden">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="180" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource Margin4}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbId}" />
|
||||
<TextBox
|
||||
x:Name="txtId103"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="400"
|
||||
Margin="{StaticResource Margin4}"
|
||||
Style="{StaticResource DefTextBox}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource Margin4}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbId3}" />
|
||||
<TextBox
|
||||
x:Name="txtSecurity103"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Width="400"
|
||||
Margin="{StaticResource Margin4}"
|
||||
Style="{StaticResource DefTextBox}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource Margin4}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbHeaderType8}" />
|
||||
<ComboBox
|
||||
x:Name="cmbHeaderType103"
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Width="200"
|
||||
Margin="{StaticResource Margin4}"
|
||||
Style="{StaticResource DefComboBox}" />
|
||||
</Grid>
|
||||
|
||||
<Separator
|
||||
x:Name="sepa2"
|
||||
|
|
|
@ -85,7 +85,7 @@ public partial class AddServerWindow
|
|||
cmbFingerprint.IsEnabled = false;
|
||||
cmbFingerprint.Text = string.Empty;
|
||||
|
||||
cmbHeaderType8.ItemsSource = Global.TuicCongestionControls;
|
||||
cmbHeaderType8.ItemsSource = Global.CongestionControls;
|
||||
break;
|
||||
|
||||
case EConfigType.WireGuard:
|
||||
|
@ -102,6 +102,49 @@ public partial class AddServerWindow
|
|||
cmbCoreType.IsEnabled = false;
|
||||
lstStreamSecurity.Add(Global.StreamSecurityReality);
|
||||
break;
|
||||
|
||||
case EConfigType.NaiveProxy:
|
||||
gridNaive.Visibility = Visibility.Visible;
|
||||
sepa2.Visibility = Visibility.Collapsed;
|
||||
gridTransport.Visibility = Visibility.Collapsed;
|
||||
cmbAlpn.IsEnabled = false;
|
||||
cmbFingerprint.IsEnabled = false;
|
||||
cmbFingerprint.Text = string.Empty;
|
||||
cmbCoreType.IsEnabled = false;
|
||||
|
||||
cmbHeaderType100.ItemsSource = Global.NaiveProxyProtocols;
|
||||
break;
|
||||
|
||||
case EConfigType.Juicity:
|
||||
gridJuicity.Visibility = Visibility.Visible;
|
||||
sepa2.Visibility = Visibility.Collapsed;
|
||||
gridTransport.Visibility = Visibility.Collapsed;
|
||||
cmbAlpn.IsEnabled = false;
|
||||
cmbFingerprint.IsEnabled = false;
|
||||
cmbFingerprint.Text = string.Empty;
|
||||
cmbCoreType.IsEnabled = false;
|
||||
|
||||
cmbHeaderType101.ItemsSource = Global.CongestionControls;
|
||||
break;
|
||||
|
||||
case EConfigType.Brook:
|
||||
gridBrook.Visibility = Visibility.Visible;
|
||||
sepa2.Visibility = Visibility.Collapsed;
|
||||
gridTransport.Visibility = Visibility.Collapsed;
|
||||
gridTls.Visibility = Visibility.Collapsed;
|
||||
cmbCoreType.IsEnabled = false;
|
||||
break;
|
||||
|
||||
case EConfigType.Shadowquic:
|
||||
gridShadowquic.Visibility = Visibility.Visible;
|
||||
sepa2.Visibility = Visibility.Collapsed;
|
||||
gridTransport.Visibility = Visibility.Collapsed;
|
||||
cmbFingerprint.IsEnabled = false;
|
||||
cmbFingerprint.Text = string.Empty;
|
||||
cmbCoreType.IsEnabled = false;
|
||||
|
||||
cmbHeaderType103.ItemsSource = Global.CongestionControls;
|
||||
break;
|
||||
}
|
||||
cmbStreamSecurity.ItemsSource = lstStreamSecurity;
|
||||
|
||||
|
@ -171,6 +214,27 @@ public partial class AddServerWindow
|
|||
case EConfigType.Anytls:
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.Id, v => v.txtId10.Text).DisposeWith(disposables);
|
||||
break;
|
||||
|
||||
case EConfigType.NaiveProxy:
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.Id, v => v.txtId100.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.HeaderType, v => v.cmbHeaderType100.Text).DisposeWith(disposables);
|
||||
break;
|
||||
|
||||
case EConfigType.Juicity:
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.Id, v => v.txtId101.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.Security, v => v.txtSecurity101.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.HeaderType, v => v.cmbHeaderType101.Text).DisposeWith(disposables);
|
||||
break;
|
||||
|
||||
case EConfigType.Brook:
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.Id, v => v.txtId102.Text).DisposeWith(disposables);
|
||||
break;
|
||||
|
||||
case EConfigType.Shadowquic:
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.Id, v => v.txtId103.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.Security, v => v.txtSecurity103.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.HeaderType, v => v.cmbHeaderType103.Text).DisposeWith(disposables);
|
||||
break;
|
||||
}
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.Network, v => v.cmbNetwork.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.HeaderType, v => v.cmbHeaderType.Text).DisposeWith(disposables);
|
||||
|
|
|
@ -112,6 +112,23 @@
|
|||
x:Name="menuAddAnytlsServer"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="{x:Static resx:ResUI.menuAddAnytlsServer}" />
|
||||
<Separator Margin="-40,5" />
|
||||
<MenuItem
|
||||
x:Name="menuAddBrookServer"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="{x:Static resx:ResUI.menuAddBrookServer}" />
|
||||
<MenuItem
|
||||
x:Name="menuAddJuicityServer"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="{x:Static resx:ResUI.menuAddJuicityServer}" />
|
||||
<MenuItem
|
||||
x:Name="menuAddNaiveServer"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="{x:Static resx:ResUI.menuAddNaiveServer}" />
|
||||
<MenuItem
|
||||
x:Name="menuAddShadowquicServer"
|
||||
Height="{StaticResource MenuItemHeight}"
|
||||
Header="{x:Static resx:ResUI.menuAddShadowquicServer}" />
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
<Separator />
|
||||
|
|
|
@ -81,6 +81,10 @@ public partial class MainWindow
|
|||
this.BindCommand(ViewModel, vm => vm.AddTuicServerCmd, v => v.menuAddTuicServer).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.AddWireguardServerCmd, v => v.menuAddWireguardServer).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.AddAnytlsServerCmd, v => v.menuAddAnytlsServer).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.AddBrookServerCmd, v => v.menuAddBrookServer).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.AddJuicityServerCmd, v => v.menuAddJuicityServer).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.AddNaiveServerCmd, v => v.menuAddNaiveServer).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.AddShadowquicServerCmd, v => v.menuAddShadowquicServer).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.AddCustomServerCmd, v => v.menuAddCustomServer).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.AddServerViaClipboardCmd, v => v.menuAddServerViaClipboard).DisposeWith(disposables);
|
||||
this.BindCommand(ViewModel, vm => vm.AddServerViaScanCmd, v => v.menuAddServerViaScan).DisposeWith(disposables);
|
||||
|
|
Loading…
Reference in a new issue