From 8d531a2930c8a3ba22c62a73c43f5c420f24a1ab Mon Sep 17 00:00:00 2001 From: next-autumn Date: Fri, 14 May 2021 19:07:19 +0800 Subject: [PATCH] save mvvmcross --- ProxySuper.Core/App.cs | 2 +- ProxySuper.Core/Models/Hosts/Host.cs | 36 ++++ ProxySuper.Core/Models/Hosts/LocalProxy.cs | 24 +++ .../Models/Hosts/LocalProxyType.cs | 25 +++ .../Models/Hosts/LoginSecretType.cs | 14 ++ .../Models/{ => Projects}/IProjectSettings.cs | 7 +- .../Models/Projects/ProjectType.cs | 15 ++ .../Models/{ => Projects}/TrojanGoSettings.cs | 4 +- .../Models/{ => Projects}/XraySettings.cs | 4 +- .../Models/{ => Projects}/XraySettings_SS.cs | 2 +- .../{ => Projects}/XraySettings_Trojan.cs | 2 +- .../{ => Projects}/XraySettings_VLESS.cs | 2 +- .../{ => Projects}/XraySettings_VMESS.cs | 2 +- .../Models/{ => Projects}/XrayType.cs | 2 +- ProxySuper.Core/Models/Record.cs | 29 ++++ ProxySuper.Core/ProxySuper.Core.csproj | 26 +-- ProxySuper.Core/Services/ProjectBase.cs | 1 + .../Services/TrojanGoConfigBuilder.cs | 1 + ProxySuper.Core/Services/TrojanGoProject.cs | 1 + ProxySuper.Core/Services/XrayConfigBuilder.cs | 1 + ProxySuper.Core/Services/XrayProject.cs | 1 + ProxySuper.Core/ViewModels/HomeViewModel.cs | 39 +++++ ProxySuper.Core/ViewModels/MainViewModel.cs | 23 --- ProxySuper.Core/ViewModels/SecondViewModel.cs | 30 ---- .../ViewModels/XrayEditorViewModel.cs | 25 +++ ProxySuper.WPF/App.xaml | 14 ++ ProxySuper.WPF/Controls/HostControl.xaml | 32 ++++ ProxySuper.WPF/Controls/HostControl.xaml.cs | 28 ++++ ProxySuper.WPF/Data/Record.json | 54 ++++++ ProxySuper.WPF/MainWindow.xaml | 13 +- ProxySuper.WPF/MainWindow.xaml.cs | 1 - ProxySuper.WPF/ProxySuper.WPF.csproj | 58 +++++-- ProxySuper.WPF/Resources/Languages/en.xaml | 13 ++ ProxySuper.WPF/Resources/Languages/zh_cn.xaml | 13 +- .../Resources/Styles/DataGridStyle.xaml | 158 ++++++++++++++++++ ProxySuper.WPF/Views/HomeView.xaml | 92 ++++++++++ ProxySuper.WPF/Views/HomeView.xaml.cs | 34 ++++ ProxySuper.WPF/Views/MainView.xaml | 40 ----- ProxySuper.WPF/Views/XrayEditorView.xaml | 21 +++ ...ainView.xaml.cs => XrayEditorView.xaml.cs} | 11 +- ProxySuper.WPF/packages.config | 2 + 41 files changed, 758 insertions(+), 144 deletions(-) create mode 100644 ProxySuper.Core/Models/Hosts/Host.cs create mode 100644 ProxySuper.Core/Models/Hosts/LocalProxy.cs create mode 100644 ProxySuper.Core/Models/Hosts/LocalProxyType.cs create mode 100644 ProxySuper.Core/Models/Hosts/LoginSecretType.cs rename ProxySuper.Core/Models/{ => Projects}/IProjectSettings.cs (77%) create mode 100644 ProxySuper.Core/Models/Projects/ProjectType.cs rename ProxySuper.Core/Models/{ => Projects}/TrojanGoSettings.cs (87%) rename ProxySuper.Core/Models/{ => Projects}/XraySettings.cs (93%) rename ProxySuper.Core/Models/{ => Projects}/XraySettings_SS.cs (92%) rename ProxySuper.Core/Models/{ => Projects}/XraySettings_Trojan.cs (84%) rename ProxySuper.Core/Models/{ => Projects}/XraySettings_VLESS.cs (95%) rename ProxySuper.Core/Models/{ => Projects}/XraySettings_VMESS.cs (94%) rename ProxySuper.Core/Models/{ => Projects}/XrayType.cs (93%) create mode 100644 ProxySuper.Core/Models/Record.cs create mode 100644 ProxySuper.Core/ViewModels/HomeViewModel.cs delete mode 100644 ProxySuper.Core/ViewModels/MainViewModel.cs delete mode 100644 ProxySuper.Core/ViewModels/SecondViewModel.cs create mode 100644 ProxySuper.Core/ViewModels/XrayEditorViewModel.cs create mode 100644 ProxySuper.WPF/Controls/HostControl.xaml create mode 100644 ProxySuper.WPF/Controls/HostControl.xaml.cs create mode 100644 ProxySuper.WPF/Data/Record.json create mode 100644 ProxySuper.WPF/Resources/Styles/DataGridStyle.xaml create mode 100644 ProxySuper.WPF/Views/HomeView.xaml create mode 100644 ProxySuper.WPF/Views/HomeView.xaml.cs delete mode 100644 ProxySuper.WPF/Views/MainView.xaml create mode 100644 ProxySuper.WPF/Views/XrayEditorView.xaml rename ProxySuper.WPF/Views/{MainView.xaml.cs => XrayEditorView.xaml.cs} (63%) diff --git a/ProxySuper.Core/App.cs b/ProxySuper.Core/App.cs index 15c815a..6c745f8 100644 --- a/ProxySuper.Core/App.cs +++ b/ProxySuper.Core/App.cs @@ -12,7 +12,7 @@ namespace ProxySuper.Core { public override void Initialize() { - RegisterAppStart(); + RegisterAppStart(); } } } diff --git a/ProxySuper.Core/Models/Hosts/Host.cs b/ProxySuper.Core/Models/Hosts/Host.cs new file mode 100644 index 0000000..6331846 --- /dev/null +++ b/ProxySuper.Core/Models/Hosts/Host.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProxySuper.Core.Models.Hosts +{ + + + public class Host + { + + public Host() + { + Proxy = new LocalProxy(); + } + + + public string Tag { get; set; } + + public string Address { get; set; } + + public string UserName { get; set; } + + public string Password { get; set; } + + public int Port { get; set; } = 22; + + public string PrivateKeyPath { get; set; } + + public LocalProxy Proxy { get; set; } + + public LoginSecretType SecretType { get; set; } + } +} diff --git a/ProxySuper.Core/Models/Hosts/LocalProxy.cs b/ProxySuper.Core/Models/Hosts/LocalProxy.cs new file mode 100644 index 0000000..38f300a --- /dev/null +++ b/ProxySuper.Core/Models/Hosts/LocalProxy.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProxySuper.Core.Models.Hosts +{ + public class LocalProxy + { + public string Address { get; set; } = "127.0.0.1"; + + public int Port { get; set; } = 1080; + + public LocalProxyType Type { get; set; } + + public string UserName { get; set; } + + public string Password { get; set; } + + } + + +} diff --git a/ProxySuper.Core/Models/Hosts/LocalProxyType.cs b/ProxySuper.Core/Models/Hosts/LocalProxyType.cs new file mode 100644 index 0000000..88c3d9d --- /dev/null +++ b/ProxySuper.Core/Models/Hosts/LocalProxyType.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProxySuper.Core.Models.Hosts +{ + public enum LocalProxyType + { + None = 0, + // + // 摘要: + // A SOCKS4 proxy server. + Socks4 = 1, + // + // 摘要: + // A SOCKS5 proxy server. + Socks5 = 2, + // + // 摘要: + // A HTTP proxy server. + Http = 3 + } +} diff --git a/ProxySuper.Core/Models/Hosts/LoginSecretType.cs b/ProxySuper.Core/Models/Hosts/LoginSecretType.cs new file mode 100644 index 0000000..1791823 --- /dev/null +++ b/ProxySuper.Core/Models/Hosts/LoginSecretType.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProxySuper.Core.Models.Hosts +{ + public enum LoginSecretType + { + Password = 0, + PrivateKey = 1 + } +} diff --git a/ProxySuper.Core/Models/IProjectSettings.cs b/ProxySuper.Core/Models/Projects/IProjectSettings.cs similarity index 77% rename from ProxySuper.Core/Models/IProjectSettings.cs rename to ProxySuper.Core/Models/Projects/IProjectSettings.cs index 2b049d0..6bd2874 100644 --- a/ProxySuper.Core/Models/IProjectSettings.cs +++ b/ProxySuper.Core/Models/Projects/IProjectSettings.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ProxySuper.Core.Models +namespace ProxySuper.Core.Models.Projects { public interface IProjectSettings { @@ -22,5 +22,10 @@ namespace ProxySuper.Core.Models /// 额外需要开放的端口 /// List FreePorts { get; } + + /// + /// 类型 + /// + ProjectType Type { get; set; } } } diff --git a/ProxySuper.Core/Models/Projects/ProjectType.cs b/ProxySuper.Core/Models/Projects/ProjectType.cs new file mode 100644 index 0000000..16b82b2 --- /dev/null +++ b/ProxySuper.Core/Models/Projects/ProjectType.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProxySuper.Core.Models.Projects +{ + public enum ProjectType + { + Xray = 0, + TrojanGo = 1, + NaiveProxy = 2 + } +} diff --git a/ProxySuper.Core/Models/TrojanGoSettings.cs b/ProxySuper.Core/Models/Projects/TrojanGoSettings.cs similarity index 87% rename from ProxySuper.Core/Models/TrojanGoSettings.cs rename to ProxySuper.Core/Models/Projects/TrojanGoSettings.cs index 2646001..f33a19f 100644 --- a/ProxySuper.Core/Models/TrojanGoSettings.cs +++ b/ProxySuper.Core/Models/Projects/TrojanGoSettings.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ProxySuper.Core.Models +namespace ProxySuper.Core.Models.Projects { public class TrojanGoSettings : IProjectSettings { @@ -16,6 +16,8 @@ namespace ProxySuper.Core.Models } } + public ProjectType Type { get; set; } = ProjectType.TrojanGo; + /// /// 域名 /// diff --git a/ProxySuper.Core/Models/XraySettings.cs b/ProxySuper.Core/Models/Projects/XraySettings.cs similarity index 93% rename from ProxySuper.Core/Models/XraySettings.cs rename to ProxySuper.Core/Models/Projects/XraySettings.cs index 77c7ce2..78ebcf6 100644 --- a/ProxySuper.Core/Models/XraySettings.cs +++ b/ProxySuper.Core/Models/Projects/XraySettings.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ProxySuper.Core.Models +namespace ProxySuper.Core.Models.Projects { public partial class XraySettings : IProjectSettings { @@ -21,6 +21,8 @@ namespace ProxySuper.Core.Models } } + public ProjectType Type { get; set; } = ProjectType.Xray; + /// /// UUID /// diff --git a/ProxySuper.Core/Models/XraySettings_SS.cs b/ProxySuper.Core/Models/Projects/XraySettings_SS.cs similarity index 92% rename from ProxySuper.Core/Models/XraySettings_SS.cs rename to ProxySuper.Core/Models/Projects/XraySettings_SS.cs index 0f0e4fb..2b5f788 100644 --- a/ProxySuper.Core/Models/XraySettings_SS.cs +++ b/ProxySuper.Core/Models/Projects/XraySettings_SS.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ProxySuper.Core.Models +namespace ProxySuper.Core.Models.Projects { public partial class XraySettings { diff --git a/ProxySuper.Core/Models/XraySettings_Trojan.cs b/ProxySuper.Core/Models/Projects/XraySettings_Trojan.cs similarity index 84% rename from ProxySuper.Core/Models/XraySettings_Trojan.cs rename to ProxySuper.Core/Models/Projects/XraySettings_Trojan.cs index 1488665..c733264 100644 --- a/ProxySuper.Core/Models/XraySettings_Trojan.cs +++ b/ProxySuper.Core/Models/Projects/XraySettings_Trojan.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ProxySuper.Core.Models +namespace ProxySuper.Core.Models.Projects { public partial class XraySettings { diff --git a/ProxySuper.Core/Models/XraySettings_VLESS.cs b/ProxySuper.Core/Models/Projects/XraySettings_VLESS.cs similarity index 95% rename from ProxySuper.Core/Models/XraySettings_VLESS.cs rename to ProxySuper.Core/Models/Projects/XraySettings_VLESS.cs index 3bd71d4..b261315 100644 --- a/ProxySuper.Core/Models/XraySettings_VLESS.cs +++ b/ProxySuper.Core/Models/Projects/XraySettings_VLESS.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ProxySuper.Core.Models +namespace ProxySuper.Core.Models.Projects { public partial class XraySettings { diff --git a/ProxySuper.Core/Models/XraySettings_VMESS.cs b/ProxySuper.Core/Models/Projects/XraySettings_VMESS.cs similarity index 94% rename from ProxySuper.Core/Models/XraySettings_VMESS.cs rename to ProxySuper.Core/Models/Projects/XraySettings_VMESS.cs index 19a009b..d4e10c6 100644 --- a/ProxySuper.Core/Models/XraySettings_VMESS.cs +++ b/ProxySuper.Core/Models/Projects/XraySettings_VMESS.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ProxySuper.Core.Models +namespace ProxySuper.Core.Models.Projects { public partial class XraySettings { diff --git a/ProxySuper.Core/Models/XrayType.cs b/ProxySuper.Core/Models/Projects/XrayType.cs similarity index 93% rename from ProxySuper.Core/Models/XrayType.cs rename to ProxySuper.Core/Models/Projects/XrayType.cs index de770a5..304cd6e 100644 --- a/ProxySuper.Core/Models/XrayType.cs +++ b/ProxySuper.Core/Models/Projects/XrayType.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace ProxySuper.Core.Models +namespace ProxySuper.Core.Models.Projects { public enum XrayType { diff --git a/ProxySuper.Core/Models/Record.cs b/ProxySuper.Core/Models/Record.cs new file mode 100644 index 0000000..dfcad7c --- /dev/null +++ b/ProxySuper.Core/Models/Record.cs @@ -0,0 +1,29 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using ProxySuper.Core.Models.Hosts; +using ProxySuper.Core.Models.Projects; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProxySuper.Core.Models +{ + public class Record + { + public Host Host { get; set; } + + [JsonProperty("settings")] + public dynamic Settings { get; set; } + + + public string Type + { + get + { + return Settings.type ?? "Xray"; + } + } + } +} diff --git a/ProxySuper.Core/ProxySuper.Core.csproj b/ProxySuper.Core/ProxySuper.Core.csproj index d9d730d..890709c 100644 --- a/ProxySuper.Core/ProxySuper.Core.csproj +++ b/ProxySuper.Core/ProxySuper.Core.csproj @@ -57,22 +57,28 @@ - - - - - - - - + + + + + + + + + + + + + + - - + + diff --git a/ProxySuper.Core/Services/ProjectBase.cs b/ProxySuper.Core/Services/ProjectBase.cs index 3905609..6fdacc4 100644 --- a/ProxySuper.Core/Services/ProjectBase.cs +++ b/ProxySuper.Core/Services/ProjectBase.cs @@ -1,5 +1,6 @@ using ProxySuper.Core.Helpers; using ProxySuper.Core.Models; +using ProxySuper.Core.Models.Projects; using Renci.SshNet; using System; using System.Collections.Generic; diff --git a/ProxySuper.Core/Services/TrojanGoConfigBuilder.cs b/ProxySuper.Core/Services/TrojanGoConfigBuilder.cs index 2c8a488..770274a 100644 --- a/ProxySuper.Core/Services/TrojanGoConfigBuilder.cs +++ b/ProxySuper.Core/Services/TrojanGoConfigBuilder.cs @@ -1,6 +1,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using ProxySuper.Core.Models; +using ProxySuper.Core.Models.Projects; using System; using System.Collections.Generic; using System.IO; diff --git a/ProxySuper.Core/Services/TrojanGoProject.cs b/ProxySuper.Core/Services/TrojanGoProject.cs index 3722eef..e0b4125 100644 --- a/ProxySuper.Core/Services/TrojanGoProject.cs +++ b/ProxySuper.Core/Services/TrojanGoProject.cs @@ -1,4 +1,5 @@ using ProxySuper.Core.Models; +using ProxySuper.Core.Models.Projects; using Renci.SshNet; using System; using System.Collections.Generic; diff --git a/ProxySuper.Core/Services/XrayConfigBuilder.cs b/ProxySuper.Core/Services/XrayConfigBuilder.cs index 998bfe1..8f814de 100644 --- a/ProxySuper.Core/Services/XrayConfigBuilder.cs +++ b/ProxySuper.Core/Services/XrayConfigBuilder.cs @@ -1,6 +1,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using ProxySuper.Core.Models; +using ProxySuper.Core.Models.Projects; using System; using System.Collections.Generic; using System.IO; diff --git a/ProxySuper.Core/Services/XrayProject.cs b/ProxySuper.Core/Services/XrayProject.cs index 9bfcd1d..2d23282 100644 --- a/ProxySuper.Core/Services/XrayProject.cs +++ b/ProxySuper.Core/Services/XrayProject.cs @@ -1,5 +1,6 @@ using Newtonsoft.Json; using ProxySuper.Core.Models; +using ProxySuper.Core.Models.Projects; using Renci.SshNet; using System; using System.Collections.Generic; diff --git a/ProxySuper.Core/ViewModels/HomeViewModel.cs b/ProxySuper.Core/ViewModels/HomeViewModel.cs new file mode 100644 index 0000000..a8022ea --- /dev/null +++ b/ProxySuper.Core/ViewModels/HomeViewModel.cs @@ -0,0 +1,39 @@ +using MvvmCross.Navigation; +using MvvmCross.ViewModels; +using Newtonsoft.Json; +using ProxySuper.Core.Models; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProxySuper.Core.ViewModels +{ + public class HomeViewModel : MvxViewModel + { + private readonly IMvxNavigationService _navigationService; + + public HomeViewModel(IMvxNavigationService navigationService) + { + _navigationService = navigationService; + ReadRecords(); + } + + private void ReadRecords() + { + var json = File.ReadAllText("Data/Record.json"); + var records = JsonConvert.DeserializeObject>(json); + this.Records = new MvxObservableCollection(); + records.ForEach(item => + { + this.Records.Add(item); + }); + + + } + + public MvxObservableCollection Records { get; set; } + } +} diff --git a/ProxySuper.Core/ViewModels/MainViewModel.cs b/ProxySuper.Core/ViewModels/MainViewModel.cs deleted file mode 100644 index 3e43785..0000000 --- a/ProxySuper.Core/ViewModels/MainViewModel.cs +++ /dev/null @@ -1,23 +0,0 @@ -using MvvmCross.Commands; -using MvvmCross.Navigation; -using MvvmCross.ViewModels; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ProxySuper.Core.ViewModels -{ - public class MainViewModel : MvxViewModel - { - private readonly IMvxNavigationService _navigationService; - - public MainViewModel(IMvxNavigationService navigationService) - { - _navigationService = navigationService; - } - - - } -} diff --git a/ProxySuper.Core/ViewModels/SecondViewModel.cs b/ProxySuper.Core/ViewModels/SecondViewModel.cs deleted file mode 100644 index d77dcf0..0000000 --- a/ProxySuper.Core/ViewModels/SecondViewModel.cs +++ /dev/null @@ -1,30 +0,0 @@ -using MvvmCross.Commands; -using MvvmCross.Navigation; -using MvvmCross.ViewModels; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ProxySuper.Core.ViewModels -{ - public class SecondViewModel : MvxViewModel - { - private readonly IMvxNavigationService _navigationService; - - public SecondViewModel(IMvxNavigationService navigationService) - { - _navigationService = navigationService; - } - - public string Message { get; set; } = "Hello world!"; - - public IMvxCommand BackCommand => new MvxCommand(Back); - - public void Back() - { - _navigationService.Close(this); - } - } -} diff --git a/ProxySuper.Core/ViewModels/XrayEditorViewModel.cs b/ProxySuper.Core/ViewModels/XrayEditorViewModel.cs new file mode 100644 index 0000000..e1c3a5b --- /dev/null +++ b/ProxySuper.Core/ViewModels/XrayEditorViewModel.cs @@ -0,0 +1,25 @@ +using MvvmCross.ViewModels; +using ProxySuper.Core.Models; +using ProxySuper.Core.Models.Hosts; +using ProxySuper.Core.Models.Projects; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProxySuper.Core.ViewModels +{ + public class XrayEditorViewModel : MvxViewModel + { + public Host Host { get; set; } + + public XraySettings Settings { get; set; } + + public override void Prepare(Record parameter) + { + Host = parameter.Host; + Settings = parameter.Settings as XraySettings; + } + } +} diff --git a/ProxySuper.WPF/App.xaml b/ProxySuper.WPF/App.xaml index 939ca3d..bca6050 100644 --- a/ProxySuper.WPF/App.xaml +++ b/ProxySuper.WPF/App.xaml @@ -3,12 +3,26 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:ProxySuper.WPF" xmlns:views="clr-namespace:MvvmCross.Platforms.Wpf.Views;assembly=MvvmCross.Platforms.Wpf" + xmlns:ui="http://schemas.modernwpf.com/2019" StartupUri="MainWindow.xaml"> + + + + + + + + + diff --git a/ProxySuper.WPF/Controls/HostControl.xaml b/ProxySuper.WPF/Controls/HostControl.xaml new file mode 100644 index 0000000..6aeabdf --- /dev/null +++ b/ProxySuper.WPF/Controls/HostControl.xaml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/ProxySuper.WPF/Controls/HostControl.xaml.cs b/ProxySuper.WPF/Controls/HostControl.xaml.cs new file mode 100644 index 0000000..f13ec61 --- /dev/null +++ b/ProxySuper.WPF/Controls/HostControl.xaml.cs @@ -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 +{ + /// + /// HostControl.xaml 的交互逻辑 + /// + public partial class HostControl : UserControl + { + public HostControl() + { + InitializeComponent(); + } + } +} diff --git a/ProxySuper.WPF/Data/Record.json b/ProxySuper.WPF/Data/Record.json new file mode 100644 index 0000000..b702e9f --- /dev/null +++ b/ProxySuper.WPF/Data/Record.json @@ -0,0 +1,54 @@ +[ + { + "host": { + "tag": "123", + "address": "122.23.36.32", + "userName": null, + "password": null, + "port": 22, + "privateKeyPath": null, + "proxy": { + "address": "127.0.0.1", + "port": 1080, + "type": 0, + "userName": null, + "password": null + }, + "secretType": 0 + }, + "settings": { + "port": 443, + "uuid": "ac082c52-0be1-4a20-a1ee-aa7e29ce2d1e", + "vlesS_WS_Path": "/vlessws", + "vlesS_H2_Path": "/vlessh2", + "vlesS_KCP_Seed": "ac082c52-0be1-4a20-a1ee-aa7e29ce2d1e", + "vlesS_KCP_Type": "none", + "vlesS_KCP_Port": 2001, + "vlesS_gRPC_ServiceName": "xray_gRPC", + "vlesS_gRPC_Port": 2002, + "vmesS_WS_Path": "/vmessws", + "vmesS_TCP_Path": "/vmesstcp", + "vmesS_H2_Path": "/vmessh2", + "vmesS_KCP_Seed": "ac082c52-0be1-4a20-a1ee-aa7e29ce2d1e", + "vmesS_KCP_Type": "none", + "vmesS_KCP_Port": 3001, + "trojanPassword": "ac082c52-0be1-4a20-a1ee-aa7e29ce2d1e", + "trojan_WS_Path": "/trojanws", + "shadowsocksPassword": "ac082c52-0be1-4a20-a1ee-aa7e29ce2d1e", + "shadowsocksMethod": "aes-128-gcm", + "shadowSocksPort": 4001, + "domain": "www.baodu.com", + "maskDomain": null, + "types": [ + 100, + 101, + 102, + 104, + 202, + 204, + 401, + 301 + ] + } + } +] \ No newline at end of file diff --git a/ProxySuper.WPF/MainWindow.xaml b/ProxySuper.WPF/MainWindow.xaml index 8557ed9..fa3a093 100644 --- a/ProxySuper.WPF/MainWindow.xaml +++ b/ProxySuper.WPF/MainWindow.xaml @@ -1,15 +1,14 @@ - - + WindowStartupLocation="CenterScreen" + Title="ProxySU" Height="600" Width="1000"> - + diff --git a/ProxySuper.WPF/MainWindow.xaml.cs b/ProxySuper.WPF/MainWindow.xaml.cs index 1421f43..ae0b3bc 100644 --- a/ProxySuper.WPF/MainWindow.xaml.cs +++ b/ProxySuper.WPF/MainWindow.xaml.cs @@ -11,7 +11,6 @@ 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 diff --git a/ProxySuper.WPF/ProxySuper.WPF.csproj b/ProxySuper.WPF/ProxySuper.WPF.csproj index 81408b4..448d145 100644 --- a/ProxySuper.WPF/ProxySuper.WPF.csproj +++ b/ProxySuper.WPF/ProxySuper.WPF.csproj @@ -50,6 +50,9 @@ ..\packages\System.Console.4.3.1\lib\net46\System.Console.dll + + ..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll + @@ -70,19 +73,32 @@ MSBuild:Compile Designer - - MainView.xaml - - - MSBuild:Compile - Designer - - - App.xaml - Code + + HostControl.xaml MainWindow.xaml + + + HomeView.xaml + + + XrayEditorView.xaml + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + App.xaml Code @@ -95,7 +111,13 @@ Designer PreserveNewest - + + Designer + MSBuild:Compile + PreserveNewest + + + Designer MSBuild:Compile @@ -117,6 +139,9 @@ ResXFileCodeGenerator Resources.Designer.cs + + PreserveNewest + SettingsSingleFileGenerator @@ -137,8 +162,13 @@ PreserveNewest - - - + + + + + 这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 + + + \ No newline at end of file diff --git a/ProxySuper.WPF/Resources/Languages/en.xaml b/ProxySuper.WPF/Resources/Languages/en.xaml index 14e42fb..b3a6b32 100644 --- a/ProxySuper.WPF/Resources/Languages/en.xaml +++ b/ProxySuper.WPF/Resources/Languages/en.xaml @@ -2,6 +2,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib"> + Add Host Actions Export Settings @@ -13,4 +14,16 @@ Helper Github + + + Tag + Address + Type + Action + Install + Edit + Delete + + + \ No newline at end of file diff --git a/ProxySuper.WPF/Resources/Languages/zh_cn.xaml b/ProxySuper.WPF/Resources/Languages/zh_cn.xaml index 3036a34..11b2e75 100644 --- a/ProxySuper.WPF/Resources/Languages/zh_cn.xaml +++ b/ProxySuper.WPF/Resources/Languages/zh_cn.xaml @@ -2,6 +2,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib"> + 添加主机 操作 导出配置 @@ -12,6 +13,14 @@ 中文 帮助 Github - - + + + + 名称 + 地址 + 类型 + 操作 + 安装 + 编辑 + 删除 \ No newline at end of file diff --git a/ProxySuper.WPF/Resources/Styles/DataGridStyle.xaml b/ProxySuper.WPF/Resources/Styles/DataGridStyle.xaml new file mode 100644 index 0000000..d24e0c2 --- /dev/null +++ b/ProxySuper.WPF/Resources/Styles/DataGridStyle.xaml @@ -0,0 +1,158 @@ + + + 33 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ProxySuper.WPF/Views/HomeView.xaml b/ProxySuper.WPF/Views/HomeView.xaml new file mode 100644 index 0000000..c29d115 --- /dev/null +++ b/ProxySuper.WPF/Views/HomeView.xaml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +