1
0
Fork 0
mirror of https://github.com/proxysu/ProxySU.git synced 2025-04-11 05:00:58 +00:00

Merge pull request #9 from proxysu/master

update
This commit is contained in:
xnxy2012 2021-12-22 17:18:00 +08:00 committed by GitHub
commit 1e8f6fcb63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 84 additions and 27 deletions

View file

@ -42,7 +42,7 @@ namespace ProxySuper.Core.Models
[JsonProperty("trojanGoSettings")] [JsonProperty("trojanGoSettings")]
public TrojanGoSettings TrojanGoSettings { get; set; } public TrojanGoSettings TrojanGoSettings { get; set; }
[JsonProperty("naiveProtoSettings")] [JsonProperty("naiveProxySettings")]
public NaiveProxySettings NaiveProxySettings { get; set; } public NaiveProxySettings NaiveProxySettings { get; set; }
[JsonProperty("brook")] [JsonProperty("brook")]

View file

@ -327,7 +327,7 @@ namespace ProxySuper.Core.Services
var result = RunCmd("id -u"); var result = RunCmd("id -u");
if (!result.Equals("0\n")) if (!result.Equals("0\n"))
{ {
throw new Exception("ProxySU需要使用Root用户进行安装"); throw new Exception("请使用Root权限账户登录");
} }
} }
@ -365,6 +365,9 @@ namespace ProxySuper.Core.Services
public void InstallSystemTools() public void InstallSystemTools()
{ {
Progress.Desc = ("更新安装包");
RunUpdateCmd();
Progress.Desc = ("安装sudo工具"); Progress.Desc = ("安装sudo工具");
InstallSoftware("sudo"); InstallSoftware("sudo");
@ -768,6 +771,22 @@ namespace ProxySuper.Core.Services
} }
} }
private void RunUpdateCmd()
{
if (CmdType == CmdType.Apt)
{
RunCmd($"apt update -y");
}
else if (CmdType == CmdType.Yum)
{
RunCmd($"yum update -y");
}
else
{
RunCmd($"dnf update -y");
}
}
private ConnectionInfo CreateConnectionInfo() private ConnectionInfo CreateConnectionInfo()
{ {
@ -799,6 +818,7 @@ namespace ProxySuper.Core.Services
return new ConnectionInfo( return new ConnectionInfo(
host: _host.Address, host: _host.Address,
username: _host.UserName, username: _host.UserName,
port: _host.Port,
authenticationMethods: authMethods.ToArray()); authenticationMethods: authMethods.ToArray());
} }

View file

@ -268,7 +268,7 @@ namespace ProxySuper.Core.Services
} }
#region #region
private void DoUploadCert(object sender, CancelEventArgs e) private void DoUploadCert(object sender, CancelEventArgs e)
{ {
@ -424,7 +424,6 @@ namespace ProxySuper.Core.Services
WriteToFile(configJson, "/etc/caddy/Caddyfile"); WriteToFile(configJson, "/etc/caddy/Caddyfile");
} }
private void UninstallXray() private void UninstallXray()
{ {
Progress.Desc = "关闭Xray服务"; Progress.Desc = "关闭Xray服务";

View file

@ -144,14 +144,14 @@
<Compile Include="Views\MTProxyGo\MTProxyGoInstallView.xaml.cs"> <Compile Include="Views\MTProxyGo\MTProxyGoInstallView.xaml.cs">
<DependentUpon>MTProxyGoInstallView.xaml</DependentUpon> <DependentUpon>MTProxyGoInstallView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\NaiveProto\NaiveProtoConfigView.xaml.cs"> <Compile Include="Views\NaiveProxy\NaiveProxyConfigView.xaml.cs">
<DependentUpon>NaiveProtoConfigView.xaml</DependentUpon> <DependentUpon>NaiveProxyConfigView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\NaiveProto\NaiveProtoEditorView.xaml.cs"> <Compile Include="Views\NaiveProxy\NaiveProxyEditorView.xaml.cs">
<DependentUpon>NaiveProtoEditorView.xaml</DependentUpon> <DependentUpon>NaiveProxyEditorView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\NaiveProto\NaiveProtoInstallView.xaml.cs"> <Compile Include="Views\NaiveProxy\NaiveProxyInstallView.xaml.cs">
<DependentUpon>NaiveProtoInstallView.xaml</DependentUpon> <DependentUpon>NaiveProxyInstallView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\ShareLinkView.xaml.cs"> <Compile Include="Views\ShareLinkView.xaml.cs">
<DependentUpon>ShareLinkView.xaml</DependentUpon> <DependentUpon>ShareLinkView.xaml</DependentUpon>
@ -299,15 +299,15 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Views\NaiveProto\NaiveProtoConfigView.xaml"> <Page Include="Views\NaiveProxy\NaiveProxyConfigView.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Views\NaiveProto\NaiveProtoEditorView.xaml"> <Page Include="Views\NaiveProxy\NaiveProxyEditorView.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Views\NaiveProto\NaiveProtoInstallView.xaml"> <Page Include="Views\NaiveProxy\NaiveProxyInstallView.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>

View file

@ -1,4 +1,5 @@
{ {
"log_level": 5,
"run_type": "server", "run_type": "server",
"local_addr": "0.0.0.0", "local_addr": "0.0.0.0",
"local_port": 443, "local_port": 443,

View file

@ -1,4 +1,4 @@
<views:MvxWindow x:Class="ProxySuper.WPF.Views.NaiveProtoConfigView" <views:MvxWindow x:Class="ProxySuper.WPF.Views.NaiveProxyConfigView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
@ -8,7 +8,7 @@
mc:Ignorable="d" mc:Ignorable="d"
Icon="/Resources/ProxySU.ico" Icon="/Resources/ProxySU.ico"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
Title="NaiveProxyConfigView" Height="450" Width="800"> Title="NaiveProxy配置" Height="450" Width="800">
<Grid Margin="10"> <Grid Margin="10">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="140" /> <ColumnDefinition Width="140" />

View file

@ -5,9 +5,9 @@ namespace ProxySuper.WPF.Views
/// <summary> /// <summary>
/// NaiveProxyConfigView.xaml 的交互逻辑 /// NaiveProxyConfigView.xaml 的交互逻辑
/// </summary> /// </summary>
public partial class NaiveProtoConfigView : MvxWindow public partial class NaiveProxyConfigView : MvxWindow
{ {
public NaiveProtoConfigView() public NaiveProxyConfigView()
{ {
InitializeComponent(); InitializeComponent();
} }

View file

@ -1,4 +1,4 @@
<views:MvxWindow x:Class="ProxySuper.WPF.Views.NaiveProtoEditorView" <views:MvxWindow x:Class="ProxySuper.WPF.Views.NaiveProxyEditorView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
@ -11,7 +11,7 @@
BorderBrush="#eee" BorderBrush="#eee"
Icon="/Resources/ProxySU.ico" Icon="/Resources/ProxySU.ico"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
Title="NaiveProxy" Height="600" Width="1000"> Title="NaiveProxy编辑配置" Height="600" Width="1000">
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="310" /> <ColumnDefinition Width="310" />

View file

@ -5,9 +5,9 @@ namespace ProxySuper.WPF.Views
/// <summary> /// <summary>
/// NaiveProxyEditorView.xaml 的交互逻辑 /// NaiveProxyEditorView.xaml 的交互逻辑
/// </summary> /// </summary>
public partial class NaiveProtoEditorView : MvxWindow public partial class NaiveProxyEditorView : MvxWindow
{ {
public NaiveProtoEditorView() public NaiveProxyEditorView()
{ {
InitializeComponent(); InitializeComponent();
} }

View file

@ -1,4 +1,4 @@
<views:MvxWindow x:Class="ProxySuper.WPF.Views.NaiveProxy.NaiveProtoInstallView" <views:MvxWindow x:Class="ProxySuper.WPF.Views.NaiveProxy.NaiveProxyInstallView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
@ -8,7 +8,7 @@
xmlns:views="clr-namespace:MvvmCross.Platforms.Wpf.Views;assembly=MvvmCross.Platforms.Wpf" xmlns:views="clr-namespace:MvvmCross.Platforms.Wpf.Views;assembly=MvvmCross.Platforms.Wpf"
mc:Ignorable="d" mc:Ignorable="d"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
Title="TrojanGoInstallView" Height="600" Width="1000"> Title="TrojanGo安装" Height="600" Width="1000">
<StackPanel> <StackPanel>
<ctrl:ProgressControl /> <ctrl:ProgressControl />

View file

@ -18,9 +18,9 @@ namespace ProxySuper.WPF.Views.NaiveProxy
/// <summary> /// <summary>
/// NaiveProxyInstallViewModel.xaml 的交互逻辑 /// NaiveProxyInstallViewModel.xaml 的交互逻辑
/// </summary> /// </summary>
public partial class NaiveProtoInstallView : MvxWindow public partial class NaiveProxyInstallView : MvxWindow
{ {
public NaiveProtoInstallView() public NaiveProxyInstallView()
{ {
InitializeComponent(); InitializeComponent();
} }

View file

@ -22,6 +22,7 @@
BorderThickness="1,0,1,0" BorderThickness="1,0,1,0"
BorderBrush="#DDD" BorderBrush="#DDD"
TabStripPlacement="Left" TabStripPlacement="Left"
x:Name="TabCtrl"
SelectionChanged="BuildQrCode"> SelectionChanged="BuildQrCode">
<TabItem Width="200" Height="40" <TabItem Width="200" Height="40"
Tag="{x:Static models:RayType.VLESS_TCP}" Tag="{x:Static models:RayType.VLESS_TCP}"

View file

@ -31,6 +31,22 @@ namespace ProxySuper.WPF.Views.V2ray
InitializeComponent(); InitializeComponent();
} }
protected override void OnRender(DrawingContext drawingContext)
{
base.OnRender(drawingContext);
for (int i = 0; i < TabCtrl.Items.Count; i++)
{
var tabItem = TabCtrl.Items[i] as TabItem;
if (Settings.Types.Contains((RayType)tabItem.Tag))
{
TabCtrl.SelectedIndex = i;
break;
}
}
}
public V2raySettings Settings public V2raySettings Settings
{ {
get get

View file

@ -21,6 +21,7 @@
Padding="10" Padding="10"
BorderThickness="1,0,1,0" BorderThickness="1,0,1,0"
BorderBrush="#DDD" BorderBrush="#DDD"
x:Name="TabCtrl"
TabStripPlacement="Left" TabStripPlacement="Left"
SelectionChanged="BuildQrCode"> SelectionChanged="BuildQrCode">
<TabItem Width="200" Height="40" <TabItem Width="200" Height="40"

View file

@ -7,6 +7,7 @@ using System.Drawing;
using System.IO; using System.IO;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
namespace ProxySuper.WPF.Views namespace ProxySuper.WPF.Views
@ -21,6 +22,22 @@ namespace ProxySuper.WPF.Views
InitializeComponent(); InitializeComponent();
} }
protected override void OnRender(DrawingContext drawingContext)
{
base.OnRender(drawingContext);
for (int i = 0; i < TabCtrl.Items.Count; i++)
{
var tabItem = TabCtrl.Items[i] as TabItem;
if (Settings.Types.Contains((RayType)tabItem.Tag))
{
TabCtrl.SelectedIndex = i;
break;
}
}
}
public XraySettings Settings public XraySettings Settings
{ {
get get
@ -29,8 +46,6 @@ namespace ProxySuper.WPF.Views
} }
} }
private void BuildQrCode(object sender, SelectionChangedEventArgs e) private void BuildQrCode(object sender, SelectionChangedEventArgs e)
{ {
var tabControl = e.Source as TabControl; var tabControl = e.Source as TabControl;

View file

@ -110,3 +110,7 @@ Microsoft [.NET Framework 4.8](https://dotnet.microsoft.com/download/dotnet-fram
* 在线提问 https://github.com/proxysu/windows/issues * 在线提问 https://github.com/proxysu/windows/issues
在使用遇到问题时,请先看一下[常见问题集锦](https://github.com/proxysu/windows/wiki/CommonError),如果还不能解决,可以到以上平台询问,个人精力有限,尽力解答。 在使用遇到问题时,请先看一下[常见问题集锦](https://github.com/proxysu/windows/wiki/CommonError),如果还不能解决,可以到以上平台询问,个人精力有限,尽力解答。