1
0
mirror of https://github.com/proxysu/ProxySU.git synced 2024-11-25 06:36:08 +03:00

save local

This commit is contained in:
nuxt-autumn 2021-05-15 16:45:36 +08:00
parent 405d8377da
commit 5e1e9e90cf
21 changed files with 1265 additions and 37 deletions

View File

@ -0,0 +1,27 @@
using MvvmCross.Converters;
using ProxySuper.Core.Models.Hosts;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace ProxySuper.Core.Converters
{
public class LoginSecretTypeConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return value.Equals(parameter);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
if (parameter == null) return LoginSecretType.Password;
return parameter;
}
}
}

View File

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace ProxySuper.Core.Converters
{
public class ProxyTypeConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return value != null && value.Equals(parameter);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
{
return Binding.DoNothing;
}
if (!value.Equals(true))
{
return Binding.DoNothing;
}
return parameter;
}
}
}

View File

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
namespace ProxySuper.Core.Converters
{
public class VisibleConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return value.Equals(true) ? Visibility.Visible : Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
{
return false;
}
if (value.Equals(Visibility.Visible))
{
return true;
}
return false;
}
}
}

View File

@ -16,7 +16,7 @@ namespace ProxySuper.Core.Models.Projects
{
VLESS_KCP_Port,
VMESS_KCP_Port,
ShadowsocksPort,
ShadowSocksPort,
};
}
}

View File

@ -21,6 +21,6 @@ namespace ProxySuper.Core.Models.Projects
/// <summary>
/// ss port
/// </summary>
public int ShadowsocksPort { get; set; }
public int ShadowSocksPort { get; set; }
}
}

View File

@ -31,7 +31,7 @@ namespace ProxySuper.Core.Models.Projects
/// <summary>
/// grpc port
/// </summary>
public string VLESS_gRPC_Port { get; set; }
public int VLESS_gRPC_Port { get; set; }
/// <summary>
/// grpc service name

View File

@ -38,6 +38,7 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\json.net\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="Renci.SshNet, Version=2020.0.1.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106, processorArchitecture=MSIL">
<HintPath>..\packages\SSH.NET.2020.0.1\lib\net40\Renci.SshNet.dll</HintPath>
@ -47,6 +48,7 @@
<HintPath>..\packages\System.Console.4.3.1\lib\net46\System.Console.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
@ -56,6 +58,9 @@
</ItemGroup>
<ItemGroup>
<Compile Include="App.cs" />
<Compile Include="Converters\LoginSecretTypeConverter.cs" />
<Compile Include="Converters\ProxyTypeConverter.cs" />
<Compile Include="Converters\VisibleConverter.cs" />
<Compile Include="Helpers\DateTimeUtils.cs" />
<Compile Include="Models\Hosts\Host.cs" />
<Compile Include="Models\Hosts\LocalProxyType.cs" />
@ -72,7 +77,9 @@
<Compile Include="Models\Projects\XrayType.cs" />
<Compile Include="Models\Record.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Services\Base64.cs" />
<Compile Include="Services\ProjectBase.cs" />
<Compile Include="Services\ShareLink.cs" />
<Compile Include="Services\TrojanGoConfigBuilder.cs" />
<Compile Include="Services\TrojanGoProject.cs" />
<Compile Include="Services\XrayConfigBuilder.cs" />
@ -83,5 +90,6 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProxySuper.Core.Services
{
public class Base64
{
public static string Encode(string plainText)
{
var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText);
return System.Convert.ToBase64String(plainTextBytes);
}
public static string Decode(string base64EncodedData)
{
var base64EncodedBytes = System.Convert.FromBase64String(base64EncodedData);
return System.Text.Encoding.UTF8.GetString(base64EncodedBytes);
}
}
}

View File

@ -0,0 +1,195 @@
using Newtonsoft.Json;
using ProxySuper.Core.Models.Projects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
namespace ProxySuper.Core.Services
{
public class ShareLink
{
public static string Build(XrayType xrayType, XraySettings settings)
{
switch (xrayType)
{
case XrayType.VLESS_TCP:
case XrayType.VLESS_TCP_XTLS:
case XrayType.VLESS_WS:
case XrayType.VLESS_KCP:
case XrayType.VLESS_gRPC:
case XrayType.Trojan_TCP:
return BuildVlessShareLink(xrayType, settings);
case XrayType.VMESS_TCP:
case XrayType.VMESS_WS:
case XrayType.VMESS_KCP:
return BuildVmessShareLink(xrayType, settings);
case XrayType.ShadowsocksAEAD:
return BuildShadowSocksShareLink(settings);
default:
return string.Empty;
}
}
private static string BuildShadowSocksShareLink(XraySettings settings)
{
var _method = settings.ShadowsocksMethod;
var _password = settings.ShadowsocksPassword;
var _server = settings.Domain;
var _port = settings.ShadowSocksPort;
var base64URL = Base64.Encode($"{_method}:{_password}@{_server}:{_port}");
return "ss://" + base64URL + "#ShadowSocks";
}
private static string BuildVmessShareLink(XrayType xrayType, XraySettings settings)
{
var vmess = new Vmess
{
v = "2",
add = settings.Domain,
port = settings.Port.ToString(),
id = settings.UUID,
aid = "0",
net = "",
type = "none",
host = settings.Domain,
path = "",
tls = "tls",
ps = "",
};
switch (xrayType)
{
case XrayType.VMESS_TCP:
vmess.ps = "vmess-tcp-tls";
vmess.net = "tcp";
vmess.type = "http";
vmess.path = settings.VMESS_TCP_Path;
break;
case XrayType.VMESS_WS:
vmess.ps = "vmess-ws-tls";
vmess.net = "ws";
vmess.type = "none";
vmess.path = settings.VMESS_WS_Path;
break;
case XrayType.VMESS_KCP:
vmess.ps = "vmess-mKCP";
vmess.port = settings.VMESS_KCP_Port.ToString();
vmess.net = "kcp";
vmess.type = settings.VMESS_KCP_Type;
vmess.path = settings.VMESS_KCP_Seed;
vmess.tls = "";
break;
default:
return string.Empty;
}
var base64Url = Base64.Encode(JsonConvert.SerializeObject(vmess));
return $"vmess://" + base64Url;
}
private static string BuildVlessShareLink(XrayType xrayType, XraySettings settings)
{
var _protocol = string.Empty;
var _uuid = settings.UUID;
var _domain = settings.Domain;
var _port = settings.Port;
var _type = string.Empty;
var _encryption = "none";
var _security = "tls";
var _path = "/";
var _host = settings.Domain;
var _descriptiveText = string.Empty;
var _headerType = "none";
var _seed = string.Empty;
switch (xrayType)
{
case XrayType.VLESS_TCP:
_protocol = "vless";
_type = "tcp";
_descriptiveText = "vless-tcp-tls";
break;
case XrayType.VLESS_TCP_XTLS:
_protocol = "vless";
_type = "tcp";
_security = "xtls";
_descriptiveText = "vless-tcp-xtls";
break;
case XrayType.VLESS_WS:
_protocol = "vless";
_type = "ws";
_path = settings.VLESS_WS_Path;
_descriptiveText = "vless-ws-tls";
break;
case XrayType.VLESS_KCP:
_protocol = "vless";
_type = "kcp";
_headerType = settings.VLESS_KCP_Type;
_seed = settings.VLESS_KCP_Seed;
_port = settings.VLESS_KCP_Port;
_security = "none";
_descriptiveText = "vless-mKCP";
break;
case XrayType.VLESS_gRPC:
_protocol = "vless";
_type = "grpc";
_path = settings.VLESS_gRPC_ServiceName;
_descriptiveText = "vless-gRPC";
break;
case XrayType.Trojan_TCP:
_protocol = "trojan";
_uuid = settings.TrojanPassword;
_descriptiveText = "trojan-tcp";
break;
default:
throw new Exception("暂未实现的协议");
}
string parametersURL = string.Empty;
if (xrayType != XrayType.Trojan_TCP)
{
// 4.3 传输层相关段
parametersURL = $"?type={_type}&encryption={_encryption}&security={_security}&path={HttpUtility.UrlEncode(_path)}&headerType={_headerType}";
// kcp
if (xrayType == XrayType.VLESS_KCP)
{
parametersURL += $"&seed={_seed}";
}
// 4.4 TLS 相关段
if (xrayType == XrayType.VLESS_TCP_XTLS)
{
parametersURL += "&flow=xtls-rprx-direct";
}
}
return $"{_protocol}://{HttpUtility.UrlEncode(_uuid)}@{_domain}:{_port}{parametersURL}#{HttpUtility.UrlEncode(_descriptiveText)}";
}
}
class Vmess
{
public string v { get; set; }
public string ps { get; set; }
public string add { get; set; }
public string port { get; set; }
public string id { get; set; }
public string aid { get; set; }
public string net { get; set; }
public string type { get; set; }
public string host { get; set; }
public string path { get; set; }
public string tls { get; set; }
}
}

View File

@ -200,7 +200,7 @@ namespace ProxySuper.Core.Services
if (parameters.Types.Contains(XrayType.ShadowsocksAEAD))
{
var ssBound = GetBound("Shadowsocks-AEAD.json");
ssBound.port = parameters.ShadowsocksPort;
ssBound.port = parameters.ShadowSocksPort;
ssBound.settings.clients[0].password = parameters.ShadowsocksPassword;
ssBound.settings.clients[0].method = parameters.ShadowsocksMethod;
xrayConfig.inbounds.Add(JToken.FromObject(ssBound));

View File

@ -112,7 +112,7 @@ namespace ProxySuper.Core.Services
WriteOutput("卸载证书");
UninstallAcme();
WriteOutput("关闭端口");
ClosePort(Parameters.ShadowsocksPort, Parameters.VMESS_KCP_Port);
ClosePort(Parameters.ShadowSocksPort, Parameters.VMESS_KCP_Port);
WriteOutput("************ 卸载完成 ************");
}

View File

@ -1,17 +1,27 @@
using MvvmCross.ViewModels;
using MvvmCross.Commands;
using MvvmCross.ViewModels;
using Newtonsoft.Json;
using ProxySuper.Core.Models;
using ProxySuper.Core.Models.Hosts;
using ProxySuper.Core.Models.Projects;
using ProxySuper.Core.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Input;
namespace ProxySuper.Core.ViewModels
{
public class XrayEditorViewModel : MvxViewModel<Record>
public partial class XrayEditorViewModel : MvxViewModel<Record>
{
public XrayEditorViewModel()
{
_randomUuid = new MvxCommand(() => GetUuid());
}
public Host Host { get; set; }
public XraySettings Settings { get; set; }
@ -19,7 +29,383 @@ namespace ProxySuper.Core.ViewModels
public override void Prepare(Record parameter)
{
Host = parameter.Host;
Settings = parameter.Settings as XraySettings;
Settings = JsonConvert.DeserializeObject<XraySettings>(JsonConvert.SerializeObject(parameter.Settings));
}
}
public partial class XrayEditorViewModel
{
private readonly ICommand _randomUuid;
public ICommand RandomUuid
{
get
{
return _randomUuid;
}
}
public int Port
{
get => Settings.Port;
set
{
Settings.Port = value;
RaisePropertyChanged("Port");
}
}
public int VLESS_KCP_Port
{
get => Settings.VLESS_KCP_Port;
set
{
Settings.VLESS_KCP_Port = value;
RaisePropertyChanged("VLESS_KCP_Port");
}
}
public int VMESS_KCP_Port
{
get => Settings.VMESS_KCP_Port;
set
{
Settings.VMESS_KCP_Port = value;
RaisePropertyChanged("VMESS_KCP_Port");
}
}
public int ShadowSocksPort
{
get => Settings.ShadowSocksPort;
set
{
Settings.VMESS_KCP_Port = value;
RaisePropertyChanged("ShadowSocksPort");
}
}
public string UUID
{
get => Settings.UUID;
set
{
Settings.UUID = value;
RaisePropertyChanged("UUID");
}
}
public string Domain
{
get => Settings.Domain;
set
{
Settings.Domain = value;
RaisePropertyChanged("Domain");
}
}
public string MaskDomain
{
get => Settings.MaskDomain;
set
{
Settings.MaskDomain = value;
RaisePropertyChanged("MaskDomain");
}
}
public string TrojanPassword
{
get => Settings.TrojanPassword;
set => Settings.TrojanPassword = value;
}
public bool Checked_Trojan_TCP
{
get
{
return Settings.Types.Contains(XrayType.Trojan_TCP);
}
set
{
if (value == true)
{
if (!Settings.Types.Contains(XrayType.Trojan_TCP))
Settings.Types.Add(XrayType.Trojan_TCP);
}
else
{
Settings.Types.Remove(XrayType.Trojan_TCP);
}
RaisePropertyChanged("Checked_Trojan_TCP");
}
}
public string Trojan_TCP_ShareLink
{
get => ShareLink.Build(XrayType.Trojan_TCP, Settings);
}
private List<string> _ssMethods = new List<string> { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305" };
public List<string> ShadowSocksMethods => _ssMethods;
public bool CheckedShadowSocks
{
get => Settings.Types.Contains(XrayType.ShadowsocksAEAD);
set
{
CheckBoxChanged(value, XrayType.ShadowsocksAEAD);
RaisePropertyChanged("CheckedShadowSocks");
}
}
public string ShadowSocksPassword
{
get => Settings.ShadowsocksPassword;
set => Settings.ShadowsocksPassword = value;
}
public string ShadowSocksMethod
{
get => Settings.ShadowsocksMethod;
set
{
var namespaceStr = typeof(ComboBoxItem).FullName + ":";
var trimValue = value.Replace(namespaceStr, "");
trimValue = trimValue.Trim();
Settings.ShadowsocksMethod = trimValue;
RaisePropertyChanged("ShadowSocksMethod");
}
}
public string ShadowSocksShareLink
{
get => ShareLink.Build(XrayType.ShadowsocksAEAD, Settings);
}
private void CheckBoxChanged(bool value, XrayType type)
{
if (value == true)
{
if (!Settings.Types.Contains(type))
{
Settings.Types.Add(type);
}
}
else
{
Settings.Types.RemoveAll(x => x == type);
}
}
private void GetUuid()
{
UUID = Guid.NewGuid().ToString();
RaisePropertyChanged("UUID");
}
}
/// <summary>
/// VMESS
/// </summary>
public partial class XrayEditorViewModel
{
// vmess tcp
public bool Checked_VMESS_TCP
{
get => Settings.Types.Contains(XrayType.VMESS_TCP);
set
{
CheckBoxChanged(value, XrayType.VMESS_TCP);
RaisePropertyChanged("Checked_VMESS_TCP");
}
}
public string VMESS_TCP_Path
{
get => Settings.VMESS_TCP_Path;
set => Settings.VMESS_TCP_Path = value;
}
public string VMESS_TCP_ShareLink
{
get => ShareLink.Build(XrayType.VMESS_TCP, Settings);
}
// vmess ws
public bool Checked_VMESS_WS
{
get => Settings.Types.Contains(XrayType.VMESS_WS);
set
{
CheckBoxChanged(value, XrayType.VMESS_WS);
RaisePropertyChanged("Checked_VMESS_WS");
}
}
public string VMESS_WS_Path
{
get => Settings.VMESS_WS_Path;
set => Settings.VMESS_WS_Path = value;
}
public string VMESS_WS_ShareLink
{
get => ShareLink.Build(XrayType.VMESS_WS, Settings);
}
// vmess kcp
public string VMESS_KCP_Seed
{
get => Settings.VMESS_KCP_Seed;
set => Settings.VMESS_KCP_Seed = value;
}
public string VMESS_KCP_Type
{
get => Settings.VMESS_KCP_Type;
set
{
var namespaceStr = typeof(ComboBoxItem).FullName + ":";
var trimValue = value.Replace(namespaceStr, "");
trimValue = trimValue.Trim();
Settings.VMESS_KCP_Type = trimValue;
RaisePropertyChanged("VMESS_KCP_Type");
}
}
public bool Checked_VMESS_KCP
{
get => Settings.Types.Contains(XrayType.VMESS_KCP);
set
{
CheckBoxChanged(value, XrayType.VMESS_KCP);
RaisePropertyChanged("Checked_VMESS_KCP");
}
}
public string VMESS_KCP_ShareLink
{
get => ShareLink.Build(XrayType.VMESS_KCP, Settings);
}
private List<string> _kcpTypes = new List<string> { "none", "srtp", "utp", "wechat-video", "dtls", "wireguard", };
public List<string> KcpTypes => _kcpTypes;
}
/// <summary>
/// VLESS
/// </summary>
public partial class XrayEditorViewModel
{
// vless xtls
public bool Checked_VLESS_TCP_XTLS
{
get => Settings.Types.Contains(XrayType.VLESS_TCP_XTLS);
set
{
CheckBoxChanged(value, XrayType.VLESS_TCP_XTLS);
RaisePropertyChanged("Checked_VLESS_TCP_XTLS");
}
}
public string VLESS_TCP_XTLS_ShareLink
{
get => ShareLink.Build(XrayType.VLESS_TCP_XTLS, Settings);
}
// vless tcp
public bool Checked_VLESS_TCP
{
get => Settings.Types.Contains(XrayType.VLESS_TCP);
set
{
CheckBoxChanged(value, XrayType.VLESS_TCP);
RaisePropertyChanged("Checked_VLESS_TCP");
}
}
public string VLESS_TCP_ShareLink
{
get => ShareLink.Build(XrayType.VLESS_TCP, Settings);
}
// vless ws
public string VLESS_WS_Path
{
get => Settings.VLESS_WS_Path;
set => Settings.VLESS_WS_Path = value;
}
public bool Checked_VLESS_WS
{
get
{
return Settings.Types.Contains(XrayType.VLESS_WS);
}
set
{
CheckBoxChanged(value, XrayType.VLESS_WS);
RaisePropertyChanged("Checked_VLESS_WS");
}
}
public string VLESS_WS_ShareLink
{
get => ShareLink.Build(XrayType.VLESS_WS, Settings);
}
// vless kcp
public string VLESS_KCP_Seed
{
get => Settings.VLESS_KCP_Seed;
set => Settings.VLESS_KCP_Seed = value;
}
public string VLESS_KCP_Type
{
get => Settings.VLESS_KCP_Type;
set
{
var namespaceStr = typeof(ComboBoxItem).FullName + ":";
var trimValue = value.Replace(namespaceStr, "");
trimValue = trimValue.Trim();
Settings.VLESS_KCP_Type = trimValue;
RaisePropertyChanged("VLESS_KCP_Type");
}
}
public bool Checked_VLESS_KCP
{
get => Settings.Types.Contains(XrayType.VLESS_KCP);
set
{
CheckBoxChanged(value, XrayType.VLESS_KCP);
RaisePropertyChanged("Checked_VLESS_KCP");
}
}
public string VLESS_KCP_ShareLink
{
get => ShareLink.Build(XrayType.VLESS_KCP, Settings);
}
// vless grpc
public string VLESS_gRPC_ServiceName
{
get => Settings.VLESS_gRPC_ServiceName;
set => Settings.VLESS_gRPC_ServiceName = value;
}
public int VLESS_gRPC_Port
{
get => Settings.VLESS_gRPC_Port;
set => Settings.VLESS_gRPC_Port = value;
}
public bool Checked_VLESS_gRPC
{
get => Settings.Types.Contains(XrayType.VLESS_gRPC);
set
{
CheckBoxChanged(value, XrayType.VLESS_gRPC);
RaisePropertyChanged("Checked_VLESS_gRPC");
}
}
public string VLESS_gRPC_ShareLink
{
get => ShareLink.Build(XrayType.VLESS_gRPC, Settings);
}
}
}

View File

@ -11,19 +11,22 @@
<!--Languages-->
<ResourceDictionary Source="/Resources/Languages/zh_cn.xaml" />
<!--components styles-->
<ResourceDictionary Source="/Resources/Styles/DataGridStyle.xaml" />
<!--styles-->
<ResourceDictionary>
<Style TargetType="{x:Type TextBox}">
<Setter Property="Padding" Value="5" />
<Setter Property="Padding" Value="5,2" />
<Setter Property="Height" Value="26" />
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>
<Style TargetType="{x:Type Label}">
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
</ResourceDictionary>
<!--components styles-->
<ResourceDictionary Source="/Resources/Styles/DataGridStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>

View File

@ -4,9 +4,24 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ProxySuper.WPF.Controls"
xmlns:convert="clr-namespace:ProxySuper.Core.Converters;assembly=ProxySuper.Core"
xmlns:host="clr-namespace:ProxySuper.Core.Models.Hosts;assembly=ProxySuper.Core"
mc:Ignorable="d">
<UserControl.Resources>
<convert:LoginSecretTypeConverter x:Key="SecretTypeConverter" />
<convert:ProxyTypeConverter x:Key="ProxyTypeConverter" />
</UserControl.Resources>
<Grid>
<GroupBox Padding="10" Header="Host">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<GroupBox Padding="10" Header="{DynamicResource HostGroupName}" Grid.Row="0">
<Grid>
<Grid.Resources >
<Style TargetType="Border" >
@ -19,6 +34,7 @@
<RowDefinition Height="36" />
<RowDefinition Height="36" />
<RowDefinition Height="36" />
<RowDefinition Height="36" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
@ -30,7 +46,6 @@
<Label Content="{DynamicResource HostTag}" Grid.Row="0" Grid.Column="0" />
<TextBox Grid.Row="0" Grid.Column="1"
Width="180"
Height="28"
Text="{Binding Host.Tag}"
VerticalContentAlignment="Center" />
@ -38,23 +53,105 @@
<Label Content="{DynamicResource HostAddress}" Grid.Row="1" Grid.Column="0" />
<TextBox Grid.Row="1" Grid.Column="1"
Width="180"
Height="28"
Text="{Binding Host.Address}"
VerticalContentAlignment="Center" />
<Label Content="{DynamicResource HostUserName}" Grid.Row="2" Grid.Column="0" />
<TextBox Grid.Row="2" Grid.Column="1"
Width="180"
Height="28"
Text="{Binding Host.UserName}"
VerticalContentAlignment="Center" />
<Label Content="{DynamicResource HostPassword}" Grid.Row="3" Grid.Column="0" />
<TextBox Grid.Row="3" Grid.Column="1"
Width="180"
Height="28"
Text="{Binding Host.Password}"
VerticalContentAlignment="Center" />
<Label Content="{DynamicResource HostSecretType}" Grid.Row="4" Grid.Column="0" />
<StackPanel Orientation="Horizontal" Grid.Row="4" Grid.Column="1" VerticalAlignment="Center">
<RadioButton GroupName="LoginSecretType"
Content="{DynamicResource HostSertTypePassword}"
IsChecked="{
Binding Host.SecretType,
Converter={StaticResource SecretTypeConverter},
ConverterParameter={x:Static host:LoginSecretType.Password}
}" />
<RadioButton GroupName="LoginSecretType"
Margin="20,0"
Content="{DynamicResource HostSertTypePrivateKey}"
IsChecked="{
Binding Host.SecretType,
Converter={StaticResource SecretTypeConverter},
ConverterParameter={x:Static host:LoginSecretType.PrivateKey}
}" />
</StackPanel>
<Label Content="{DynamicResource HostUploadSecretKey}" Grid.Row="5" Grid.Column="0" />
<Button Height="24"
Width="100"
HorizontalAlignment="Left"
Grid.Row="5" Grid.Column="1"
IsEnabled="{
Binding Host.SecretType,
Converter={StaticResource SecretTypeConverter},
ConverterParameter={x:Static host:LoginSecretType.PrivateKey}
}"
Content="{DynamicResource HostUploadSecretKey}" />
</Grid>
</GroupBox>
<GroupBox Padding="10" Header="{DynamicResource ProxyGroupName}" Grid.Row="1" Margin="0,10,0,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="36" />
<RowDefinition Height="36" />
<RowDefinition Height="36" />
<RowDefinition Height="36" />
<RowDefinition Height="36" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80" />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<Label Content="{DynamicResource ProxyType}" Grid.Row="0" Grid.Column="0" />
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center">
<RadioButton Content="{DynamicResource ProxyTypeNone}"
Margin="0,0,5,0"
IsChecked="{
Binding Host.Proxy.Type,
Converter={StaticResource ProxyTypeConverter},
ConverterParameter={x:Static host:LocalProxyType.None}
}"/>
<RadioButton Content="{DynamicResource ProxyTypeHttp}"
Margin="5,0"
IsChecked="{
Binding Host.Proxy.Type,
Converter={StaticResource ProxyTypeConverter},
ConverterParameter={x:Static host:LocalProxyType.Http}
}"/>
<RadioButton Content="{DynamicResource ProxyTypeSocks5}"
Margin="5,0"
IsChecked="{
Binding Host.Proxy.Type,
Converter={StaticResource ProxyTypeConverter},
ConverterParameter={x:Static host:LocalProxyType.Socks5}
}"/>
</StackPanel>
<Label Content="{DynamicResource ProxyAddress}" Grid.Row="1" Grid.Column="0" />
<TextBox Text="{Binding Host.Proxy.Address}" Grid.Row="1" Grid.Column="1" />
<Label Content="{DynamicResource ProxyUserName}" Grid.Row="2" Grid.Column="0" />
<TextBox Text="{Binding Host.Proxy.UserName}" Grid.Row="2" Grid.Column="1" />
<Label Content="{DynamicResource HostPort}" Grid.Row="3" Grid.Column="0" />
<TextBox Text="{Binding Host.Proxy.Port}" Grid.Row="3" Grid.Column="1" />
<Label Content="{DynamicResource ProxyPassword}" Grid.Row="4" Grid.Column="0" />
<TextBox Text="{Binding Host.Proxy.Password}" Grid.Row="4" Grid.Column="1" />
</Grid>
</GroupBox>
</Grid>

View File

@ -0,0 +1,293 @@
<UserControl x:Class="ProxySuper.WPF.Controls.XraySettingsControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ProxySuper.WPF.Controls"
xmlns:convert="clr-namespace:ProxySuper.Core.Converters;assembly=ProxySuper.Core"
mc:Ignorable="d">
<UserControl.Resources>
<convert:VisibleConverter x:Key="VisibleConverter" />
</UserControl.Resources>
<StackPanel Orientation="Horizontal">
<StackPanel Width="220">
<!--XTLS-->
<CheckBox Margin="0,10,0,0"
VerticalContentAlignment="Center"
IsChecked="{Binding Path=Checked_VLESS_TCP_XTLS}">
<Label Content="{DynamicResource VlessXtlsDesc}" FontSize="13" Foreground="LimeGreen" />
</CheckBox>
<!--TCP-->
<CheckBox Margin="0,15,0,0"
VerticalContentAlignment="Center"
IsChecked="{Binding Path=Checked_VLESS_TCP}">
<Label Content="{DynamicResource VlessTcpDesc}" FontSize="13" Foreground="LimeGreen" />
</CheckBox>
<!--WebSocket-->
<CheckBox Margin="0,15,0,0"
VerticalContentAlignment="Center"
IsChecked="{Binding Path=Checked_VLESS_WS}">
<Label Content="{DynamicResource VlessWsDesc}" FontSize="13" Foreground="LimeGreen" />
</CheckBox>
<!--mKCP-->
<CheckBox Margin="0,15,0,0"
VerticalContentAlignment="Center"
Foreground="LimeGreen"
IsChecked="{Binding Path=Checked_VLESS_KCP}">
<Label Content="{DynamicResource VlessKcpDesc}" FontSize="13" Foreground="LimeGreen" />
</CheckBox>
<!--TCP-->
<!--<CheckBox Content="VMESS over TCP with TLS&#x0a;不推荐"
Margin="0,15,0,0"
FontSize="13"
Style="{StaticResource MahApps.Styles.CheckBox}"
IsChecked="{Binding Path=Checked_VMESS_TCP}" />-->
<!--WebSocket-->
<CheckBox Margin="0,15,0,0"
VerticalContentAlignment="Center"
IsChecked="{Binding Path=Checked_VMESS_WS}">
<Label Content="{DynamicResource VmessWsDesc}" FontSize="13" Foreground="Blue" />
</CheckBox>
<!--mKCP-->
<CheckBox Margin="0,15,0,0"
VerticalContentAlignment="Center"
IsChecked="{Binding Path=Checked_VMESS_KCP}">
<Label Foreground="Blue" FontSize="13" Content="{DynamicResource VmessKcpDesc}" />
</CheckBox>
<!--ss-->
<CheckBox Margin="0,15,0,0"
VerticalContentAlignment="Center"
IsChecked="{Binding Path=CheckedShadowSocks}">
<Label Content="{DynamicResource SSDesc}" FontSize="13" Foreground="Fuchsia" />
</CheckBox>
<!--Trojan-->
<CheckBox Margin="0,15,0,0"
Foreground="CadetBlue"
VerticalContentAlignment="Center"
IsChecked="{Binding Path=Checked_Trojan_TCP}">
<Label Content="{DynamicResource TrojanDesc}" FontSize="13" Foreground="CadetBlue" />
</CheckBox>
<!--gRPC-->
<!--<CheckBox Content="VLESS gRPC&#x0a;基于http2多路复用。"
Margin="0,15,0,0"
Grid.Column="0"
Style="{StaticResource MahApps.Styles.CheckBox}"
IsChecked="{Binding Path=Checked_VLESS_gRPC}"/>-->
</StackPanel>
<!--************************** 参数 **************************-->
<StackPanel Width="auto">
<!--Domain-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal">
<Label Content="{DynamicResource XrayDomain}" Width="120" />
<TextBox Text="{Binding Path=Domain}" Width="200" />
</StackPanel>
<!--Mask Domain-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal">
<Label Content="{DynamicResource XrayMarkDomain}" Width="120" />
<TextBox Text="{Binding Path=MaskDomain}" Width="200" />
</StackPanel>
<!--UUID-->
<StackPanel Margin="40,10,0,0"
Orientation="Horizontal">
<Label Content="{DynamicResource XrayUUID}" Width="120" />
<TextBox Text="{Binding Path=UUID}"
Width="200" />
<Button Margin="5,0,0,0"
Padding="12,3"
Command="{Binding Path=RandomUuid}"
Content="{DynamicResource Random}" />
</StackPanel>
<!--WebSocket Path-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Checked_VLESS_WS,
Converter={StaticResource VisibleConverter}
}">
<Label Content="{DynamicResource VlessWsPath}" Foreground="LimeGreen" Width="120" />
<TextBox Text="{Binding Path=VLESS_WS_Path}"
Width="200" />
</StackPanel>
<!--seed-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Checked_VLESS_KCP,
Converter={StaticResource VisibleConverter}
}">
<Label Content="{DynamicResource VlessKcpSeed}" Foreground="LimeGreen" Width="120" />
<TextBox Text="{Binding Path=VLESS_KCP_Seed}" Width="200" />
</StackPanel>
<!--kcp type-->
<StackPanel Margin="40,15,0,0"
Visibility="{
Binding Path=Checked_VLESS_KCP,
Converter={StaticResource VisibleConverter}
}" Orientation="Horizontal">
<Label Content="{DynamicResource VlessKcpType}" Foreground="LimeGreen" Width="120" />
<ComboBox Width="200"
ItemsSource="{Binding Path=KcpTypes}"
SelectedValue="{Binding VLESS_KCP_Type,Mode=TwoWay}">
</ComboBox>
</StackPanel>
<!--kcp port-->
<StackPanel Margin="40,15,0,0"
Visibility="{
Binding Path=Checked_VLESS_KCP,
Converter={StaticResource VisibleConverter}
}"
Orientation="Horizontal">
<Label Content="{DynamicResource VlessKcpPort}" Width="120" Foreground="LimeGreen" />
<TextBox Text="{Binding Path=VLESS_KCP_Port}" Width="200" />
</StackPanel>
<!--gRPC Port-->
<!--<StackPanel Margin="40,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Checked_VLESS_gRPC,
Converter={StaticResource VisibleConverter}
}">
<Label Content="gRPC端口" Width="120" Foreground="LimeGreen" />
<TextBox Text="{Binding Path=VLESS_gRPC_Port}" Width="120" />
<Label Content="服务器" Width="120" Margin="10,0,0,0" Foreground="LimeGreen" />
<TextBox Text="{Binding Path=VLESS_gRPC_ServiceName}" Width="120" />
</StackPanel>-->
<!--Tcp Path-->
<!--<StackPanel Margin="40,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Checked_VMESS_TCP,
Converter={StaticResource VisibleConverter}
}">
<Label Content="VMESS WS路径" Foreground="Blue" Width="120" />
<TextBox Text="{Binding Path=VMESS_TCP_Path}"
VerticalAlignment="Bottom"
Width="200" />
</StackPanel>-->
<!--WebSocket Path-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Checked_VMESS_WS,
Converter={StaticResource VisibleConverter}
}">
<Label Content="{DynamicResource VmessWsPath}" Foreground="Blue" Width="120" />
<TextBox Text="{Binding Path=VMESS_WS_Path}"
VerticalAlignment="Bottom"
Width="200" />
</StackPanel>
<!--seed-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Checked_VMESS_KCP,
Converter={StaticResource VisibleConverter}
}">
<Label Content="{DynamicResource VmessKcpSeed}" Foreground="Blue" Width="120" />
<TextBox Text="{Binding Path=VMESS_KCP_Seed}" Width="200" />
</StackPanel>
<!--kcp type-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Checked_VMESS_KCP,
Converter={StaticResource VisibleConverter}
}">
<Label Content="{DynamicResource VmessKcpType}" Foreground="Blue" Width="120" VerticalAlignment="Bottom"/>
<ComboBox Width="200"
VerticalAlignment="Bottom"
ItemsSource="{Binding Path=KcpTypes}"
SelectedValue="{Binding VMESS_KCP_Type,Mode=TwoWay}">
</ComboBox>
</StackPanel>
<!--kcp port-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Checked_VMESS_KCP,
Converter={StaticResource VisibleConverter}
}">
<Label Content="{DynamicResource VmessKcpPort}" Foreground="Blue" Width="120" />
<TextBox Text="{Binding Path=VMESS_KCP_Port}" Width="200" />
</StackPanel>
<!--ss密码-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=CheckedShadowSocks,
Converter={StaticResource VisibleConverter}
}">
<Label Content="{DynamicResource SSPassword}" Foreground="Fuchsia" Width="120" />
<TextBox Text="{Binding Path=ShadowSocksPassword}"
Width="200"/>
</StackPanel>
<!--ss加密方式-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=CheckedShadowSocks,
Converter={StaticResource VisibleConverter}
}">
<Label Content="{DynamicResource SSMethods}" Foreground="Fuchsia" Width="120" />
<ComboBox Width="200"
ItemsSource="{Binding ShadowSocksMethods}"
SelectedValue="{Binding ShadowSocksMethod}">
</ComboBox>
</StackPanel>
<!--Trojan密码-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Checked_Trojan_TCP,
Converter={StaticResource VisibleConverter}
}">
<Label Content="{DynamicResource TrojanPassword}" Foreground="CadetBlue" Width="120" />
<TextBox Text="{Binding Path=TrojanPassword}"
Width="200" />
</StackPanel>
<!--xray prot-->
<StackPanel Margin="40,15,0,0"
Orientation="Horizontal">
<Label Content="{DynamicResource XrayPort}" Foreground="Gray" Width="120" />
<TextBox Text="{Binding Path=Port}" Width="120" />
<Label Content="{DynamicResource XrayPortDefault}" Foreground="Red" />
</StackPanel>
</StackPanel>
</StackPanel>
</UserControl>

View File

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ProxySuper.WPF.Controls
{
/// <summary>
/// XraySettingsControl.xaml 的交互逻辑
/// </summary>
public partial class XraySettingsControl : UserControl
{
public XraySettingsControl()
{
InitializeComponent();
}
}
}

View File

@ -76,6 +76,9 @@
<Compile Include="Controls\HostControl.xaml.cs">
<DependentUpon>HostControl.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\XraySettingsControl.xaml.cs">
<DependentUpon>XraySettingsControl.xaml</DependentUpon>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
</Compile>
@ -89,6 +92,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\XraySettingsControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>

View File

@ -31,5 +31,48 @@
<sys:String x:Key="HostUserName">UserName</sys:String>
<sys:String x:Key="HostPassword">Password</sys:String>
<sys:String x:Key="HostPort">Port</sys:String>
<sys:String x:Key="HostSecretType">SecretType</sys:String>
<sys:String x:Key="HostUploadSecretKey">UploadSecretKey</sys:String>
<sys:String x:Key="HostSertTypePassword">Password</sys:String>
<sys:String x:Key="HostSertTypePrivateKey">PrivateKey</sys:String>
<sys:String x:Key="ProxyGroupName">Proxy</sys:String>
<sys:String x:Key="ProxyAddress">Address</sys:String>
<sys:String x:Key="ProxyPort">Port</sys:String>
<sys:String x:Key="ProxyUserName">UserName</sys:String>
<sys:String x:Key="ProxyPassword">Password</sys:String>
<sys:String x:Key="ProxyType">Type</sys:String>
<sys:String x:Key="ProxyTypeNone">None</sys:String>
<sys:String x:Key="ProxyTypeHttp">Http</sys:String>
<sys:String x:Key="ProxyTypeSocks5">Socks5</sys:String>
<!--Xray-->
<sys:String x:Key="Random">Random</sys:String>
<sys:String x:Key="VlessXtlsDesc" xml:space="preserve">VLESS over TCP With XTLS&#x0a;Preferred</sys:String>
<sys:String x:Key="VlessTcpDesc" xml:space="preserve">VLESS over TCP with TLS&#x0a;XTLS is Preferred</sys:String>
<sys:String x:Key="VlessWsDesc" xml:space="preserve">VLESS over WS with TLS&#x0a;Support CDN</sys:String>
<sys:String x:Key="VlessKcpDesc" xml:space="preserve">VLESS mKCP&#x0a;low delay</sys:String>
<sys:String x:Key="VmessWsDesc" xml:space="preserve">VMESS over WS with TLS&#x0a;Support CDN</sys:String>
<sys:String x:Key="VmessKcpDesc" xml:space="preserve">VMESS mKCP&#x0a;low delay</sys:String>
<sys:String x:Key="SSDesc" xml:space="preserve">ShadowSocks&#x0a;Support CDN</sys:String>
<sys:String x:Key="TrojanDesc" xml:space="preserve">Trojan over TCP with TLS&#x0a;Trojan</sys:String>
<sys:String x:Key="XrayDomain">Address</sys:String>
<sys:String x:Key="XrayMarkDomain">GuiseHost</sys:String>
<sys:String x:Key="XrayUUID">UUID</sys:String>
<sys:String x:Key="VlessWsPath">VLESS WS Path</sys:String>
<sys:String x:Key="VlessKcpSeed">VLESS KCP Seed</sys:String>
<sys:String x:Key="VlessKcpType">VLESS KCP Type</sys:String>
<sys:String x:Key="VlessKcpPort">VLESS KCP Port</sys:String>
<sys:String x:Key="VmessWsPath">VMESS WS Path</sys:String>
<sys:String x:Key="VmessKcpSeed">VMESS KCP Seed</sys:String>
<sys:String x:Key="VmessKcpType">VMESS KCP Type</sys:String>
<sys:String x:Key="VmessKcpPort">VMESS KCP Port</sys:String>
<sys:String x:Key="SSPassword">SS Pwd</sys:String>
<sys:String x:Key="SSMethods">SS Method</sys:String>
<sys:String x:Key="TrojanPassword">Trojan Pwd</sys:String>
<sys:String x:Key="XrayPort">xray Port</sys:String>
<sys:String x:Key="XrayPortDefault">default port is 443</sys:String>
</ResourceDictionary>

View File

@ -26,10 +26,53 @@
<!--Editor Window-->
<sys:String x:Key="HostTag">Tag</sys:String>
<sys:String x:Key="HostAddress">Address</sys:String>
<sys:String x:Key="HostUserName">UserName</sys:String>
<sys:String x:Key="HostPassword">Password</sys:String>
<sys:String x:Key="HostPort">Port</sys:String>
<sys:String x:Key="HostGroupName">主机</sys:String>
<sys:String x:Key="HostTag">名称</sys:String>
<sys:String x:Key="HostAddress">IP/地址</sys:String>
<sys:String x:Key="HostUserName">用户名</sys:String>
<sys:String x:Key="HostPassword">密码</sys:String>
<sys:String x:Key="HostPort">端口</sys:String>
<sys:String x:Key="HostSecretType">登陆验证</sys:String>
<sys:String x:Key="HostUploadSecretKey">上传Key</sys:String>
<sys:String x:Key="HostSertTypePassword">密码</sys:String>
<sys:String x:Key="HostSertTypePrivateKey">私钥</sys:String>
<sys:String x:Key="ProxyGroupName">代理</sys:String>
<sys:String x:Key="ProxyAddress">IP/地址</sys:String>
<sys:String x:Key="ProxyPort">端口</sys:String>
<sys:String x:Key="ProxyUserName">用户名</sys:String>
<sys:String x:Key="ProxyPassword">密码</sys:String>
<sys:String x:Key="ProxyType">类型</sys:String>
<sys:String x:Key="ProxyTypeNone">无</sys:String>
<sys:String x:Key="ProxyTypeHttp">Http</sys:String>
<sys:String x:Key="ProxyTypeSocks5">Socks5</sys:String>
<!--Xray-->
<sys:String x:Key="Random">随机</sys:String>
<sys:String x:Key="VlessXtlsDesc" xml:space="preserve">VLESS Over TCP With XTLS&#x0a;性能数倍,首选方式。</sys:String>
<sys:String x:Key="VlessTcpDesc" xml:space="preserve">VLESS over TCP with TLS&#x0a;仍推荐XTLS。</sys:String>
<sys:String x:Key="VlessWsDesc" xml:space="preserve">VLESS over WS with TLS&#x0a;推荐支持CDN。</sys:String>
<sys:String x:Key="VlessKcpDesc" xml:space="preserve">VLESS mKCP&#x0a;游戏推荐,延迟低。</sys:String>
<sys:String x:Key="VmessWsDesc" xml:space="preserve">VMESS over WS with TLS&#x0a;推荐支持CDN。</sys:String>
<sys:String x:Key="VmessKcpDesc" xml:space="preserve">VMESS mKCP&#x0a;游戏推荐,延迟低。</sys:String>
<sys:String x:Key="SSDesc" xml:space="preserve">ShadowSocks&#x0a;SS支持udp。</sys:String>
<sys:String x:Key="TrojanDesc" xml:space="preserve">Trojan over TCP with TLS&#x0a;Trojan。</sys:String>
<sys:String x:Key="XrayDomain">域名</sys:String>
<sys:String x:Key="XrayMarkDomain">伪装域名</sys:String>
<sys:String x:Key="XrayUUID">UUID</sys:String>
<sys:String x:Key="VlessWsPath">VLESS WS路径</sys:String>
<sys:String x:Key="VlessKcpSeed">VLESS KCP Seed</sys:String>
<sys:String x:Key="VlessKcpType">VLESS KCP伪装</sys:String>
<sys:String x:Key="VlessKcpPort">VLESS KCP端口</sys:String>
<sys:String x:Key="VmessWsPath">VMESS WS路径</sys:String>
<sys:String x:Key="VmessKcpSeed">VMESS KCP Seed</sys:String>
<sys:String x:Key="VmessKcpType">VMESS KCP伪装</sys:String>
<sys:String x:Key="VmessKcpPort">VMESS KCP端口</sys:String>
<sys:String x:Key="SSPassword">SS密码</sys:String>
<sys:String x:Key="SSMethods">SS加密方式</sys:String>
<sys:String x:Key="TrojanPassword">Trojan密码</sys:String>
<sys:String x:Key="XrayPort">xray端口</sys:String>
<sys:String x:Key="XrayPortDefault">默认端口443不建议修改</sys:String>
</ResourceDictionary>

View File

@ -63,23 +63,23 @@
Header="{DynamicResource MainDataGridColumnType}"
Width="200" />
<DataGridTemplateColumn Header="{DynamicResource MainDataGridColumnAction}">
<DataGridTemplateColumn Header="{DynamicResource MainDataGridColumnAction}" Width="400">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Button Padding="10,3"
Click="NavToEditor"
<Button Click="NavToEditor"
Margin="5,0"
Padding="12,3"
Content="{DynamicResource MainDataGridColumnActionInstall}" />
<Button Padding="10,3"
Click="NavToEditor"
<Button Click="NavToEditor"
Margin="5,0"
Padding="12,3"
Content="{DynamicResource MainDataGridColumnActionEdit}" />
<Button Padding="10,3"
Click="NavToEditor"
<Button Click="NavToEditor"
Margin="5,0"
Padding="12,3"
Content="{DynamicResource MainDataGridColumnActionDelete}" />
</StackPanel>
</DataTemplate>

View File

@ -9,10 +9,14 @@
mc:Ignorable="d"
WindowStartupLocation="CenterScreen"
Icon="/Resources/ProxySU.ico"
BorderThickness="0,1,0,0"
BorderBrush="#EEE"
Title="XrayEditorView" Height="600" Width="1000">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="320" />
<ColumnDefinition Width="1" />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
@ -20,6 +24,10 @@
<ctrl:HostControl />
</StackPanel>
<StackPanel Grid.Column="1"></StackPanel>
<StackPanel Grid.Column="1" Background="#EEE"></StackPanel>
<StackPanel Grid.Column="2">
<ctrl:XraySettingsControl />
</StackPanel>
</Grid>
</views:MvxWindow>