1
0
mirror of https://github.com/proxysu/ProxySU.git synced 2024-11-24 22:26:07 +03:00
This commit is contained in:
next-autumn 2021-02-28 18:22:21 +08:00
parent d04553034a
commit 2fd76baf2f
6 changed files with 79 additions and 22 deletions

View File

@ -205,6 +205,9 @@
<Compile Include="Views\TerminalWindow.xaml.cs">
<DependentUpon>TerminalWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Views\XrayWindow.xaml.cs">
<DependentUpon>XrayWindow.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Converters\LoginSecretTypeConverter.cs" />
@ -291,6 +294,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\XrayWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\MaterialDesignThemes.4.0.0\build\MaterialDesignThemes.targets" Condition="Exists('..\packages\MaterialDesignThemes.4.0.0\build\MaterialDesignThemes.targets')" />

View File

@ -24,8 +24,6 @@ namespace ProxySU_Core.ViewModels.Developers
private const string ServerReverseDir = @"Templates\xray\server\09_reverse";
private const string CaddyFileDir = @"Templates\xray\caddy";
private int randomCaddyListenPort = 8800;
public XrayProject(SshClient sshClient, XrayParameters parameters, Action<string> writeOutput) : base(sshClient, parameters, writeOutput)
{
}

View File

@ -14,7 +14,7 @@
Foreground="LawnGreen"
FontSize="14"
FontFamily="Consolas"
Height="400">
Height="320">
<FlowDocument>
<Paragraph>
<Run Text="{Binding Path=OutputText, Mode=OneWay}" />
@ -23,8 +23,10 @@
</RichTextBox>
<StackPanel Margin="0,10,0,0">
<Button Content="{DynamicResource Install}"
Click="Install"/>
<Button Content="安装Xray"
Click="Install"
Height="32"
Width="100"/>
</StackPanel>
</StackPanel>

View File

@ -1,6 +1,7 @@
using MahApps.Metro.Controls.Dialogs;
using ProxySU_Core.ViewModels;
using ProxySU_Core.ViewModels.Developers;
using ProxySU_Core.Views;
using Renci.SshNet;
using System;
using System.Collections.Generic;
@ -106,22 +107,9 @@ namespace ProxySU_Core
private void Install(object sender, RoutedEventArgs e)
{
var project = new XrayProject(
_sshClient,
new XrayParameters { Port = 443 },
WriteShell
);
Task.Run(() =>
{
try
{
project.Execute();
}
catch (Exception ex)
{
_vm.AddOutput(ex.Message);
}
});
var xrayWindow = new XrayWindow();
xrayWindow.ShowDialog();
}

View File

@ -0,0 +1,35 @@
<metro:MetroWindow x:Class="ProxySU_Core.Views.XrayWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ProxySU_Core.Views"
xmlns:metro="http://metro.mahapps.com/winfx/xaml/controls"
mc:Ignorable="d"
Title="XrayWindow" Height="450" Width="800">
<StackPanel Orientation="Horizontal">
<StackPanel Margin="20">
<CheckBox Content="VLESS OVER TCP with XTLS" Style="{StaticResource MahApps.Styles.CheckBox}" />
<Label Content="数倍性能首选方式不支持CDN" Margin="20,0,0,0" />
<CheckBox Content="VLESS over TCP with TLS" Style="{StaticResource MahApps.Styles.CheckBox}" Margin="0,10,0,0" />
<Label Content="不支持CDN" Margin="20,0,0,0" />
<CheckBox Content="VLESS over WS with TLS" Style="{StaticResource MahApps.Styles.CheckBox}" Margin="0,10,0,0" />
<Label Content="推荐支持CDN" Margin="20,0,0,0" />
<CheckBox Content="VMess over TCP with TLS" Style="{StaticResource MahApps.Styles.CheckBox}" Margin="0,10,0,0" />
<Label Content="不推荐" Margin="20,0,0,0" Foreground="Red" />
<CheckBox Content="VMess over WS with TLS" Style="{StaticResource MahApps.Styles.CheckBox}" Margin="0,10,0,0" />
<Label Content="常规支持CDN" Margin="20,0,0,0" />
<CheckBox Content="Trojan over TCP with TLS" Style="{StaticResource MahApps.Styles.CheckBox}" Margin="0,10,0,0" />
<Label Content="Torjan协议不支持CDN" Margin="20,0,0,0" />
</StackPanel>
<StackPanel>
<Label Content="选择方式" />
</StackPanel>
</StackPanel>
</metro:MetroWindow>

View File

@ -0,0 +1,27 @@
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.Shapes;
namespace ProxySU_Core.Views
{
/// <summary>
/// XrayWindow.xaml 的交互逻辑
/// </summary>
public partial class XrayWindow
{
public XrayWindow()
{
InitializeComponent();
}
}
}