1
0
mirror of https://github.com/proxysu/ProxySU.git synced 2024-11-24 22:26:07 +03:00
This commit is contained in:
autumn 2021-06-29 16:08:45 +08:00
parent 395d01aea8
commit 2f0f9fb09d
6 changed files with 161 additions and 125 deletions

View File

@ -67,6 +67,7 @@
<Compile Include="Converters\ProxyTypeConverter.cs" />
<Compile Include="Converters\VisibleConverter.cs" />
<Compile Include="Helpers\DateTimeUtils.cs" />
<Compile Include="Helpers\Rand.cs" />
<Compile Include="Models\Hosts\Host.cs" />
<Compile Include="Models\Hosts\LocalProxyType.cs" />
<Compile Include="Models\Hosts\LoginSecretType.cs" />

View File

@ -215,6 +215,13 @@ namespace ProxySuper.Core.Services
RunCmd(GetInstallCmd("xz-devel"));
}
// 检测是否安装cron
cmd = RunCmd("command -v cron");
if (string.IsNullOrEmpty(cmd))
{
RunCmd(GetInstallCmd("cron"));
}
// 检测是否安装lsof
cmd = RunCmd("command -v lsof");
if (string.IsNullOrEmpty(cmd))

View File

@ -10,165 +10,165 @@
<UserControl.Resources>
<convert:VisibleConverter x:Key="VisibleConverter" />
</UserControl.Resources>
<StackPanel Orientation="Horizontal">
<StackPanel Width="220">
<!--XTLS-->
<CheckBox Margin="0,10,0,0"
<!--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>
<Label Content="{DynamicResource VlessXtlsDesc}" FontSize="13" Foreground="LimeGreen" />
</CheckBox>
<!--TCP-->
<CheckBox Margin="0,15,0,0"
<!--TCP-->
<CheckBox Margin="0,15,0,0"
VerticalContentAlignment="Center"
IsChecked="{Binding Path=Checked_VLESS_TCP}">
<Label Content="{DynamicResource VlessTcpDesc}" FontSize="13" Foreground="LimeGreen" />
</CheckBox>
<Label Content="{DynamicResource VlessTcpDesc}" FontSize="13" Foreground="LimeGreen" />
</CheckBox>
<!--WebSocket-->
<CheckBox Margin="0,15,0,0"
<!--WebSocket-->
<CheckBox Margin="0,15,0,0"
VerticalContentAlignment="Center"
IsChecked="{Binding Path=Checked_VLESS_WS}">
<Label Content="{DynamicResource VlessWsDesc}" FontSize="13" Foreground="LimeGreen" />
</CheckBox>
<Label Content="{DynamicResource VlessWsDesc}" FontSize="13" Foreground="LimeGreen" />
</CheckBox>
<!--mKCP-->
<CheckBox Margin="0,15,0,0"
<!--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>
<Label Content="{DynamicResource VlessKcpDesc}" FontSize="13" Foreground="LimeGreen" />
</CheckBox>
<!--TCP-->
<!--<CheckBox Content="VMESS over TCP with TLS&#x0a;不推荐"
<!--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"
<!--WebSocket-->
<CheckBox Margin="0,15,0,0"
VerticalContentAlignment="Center"
IsChecked="{Binding Path=Checked_VMESS_WS}">
<Label Content="{DynamicResource VmessWsDesc}" FontSize="13" Foreground="Blue" />
</CheckBox>
<Label Content="{DynamicResource VmessWsDesc}" FontSize="13" Foreground="Blue" />
</CheckBox>
<!--mKCP-->
<CheckBox Margin="0,15,0,0"
<!--mKCP-->
<CheckBox Margin="0,15,0,0"
VerticalContentAlignment="Center"
IsChecked="{Binding Path=Checked_VMESS_KCP}">
<Label Foreground="Blue" FontSize="13" Content="{DynamicResource VmessKcpDesc}" />
</CheckBox>
<Label Foreground="Blue" FontSize="13" Content="{DynamicResource VmessKcpDesc}" />
</CheckBox>
<!--ss-->
<CheckBox Margin="0,15,0,0"
<!--ss-->
<CheckBox Margin="0,15,0,0"
VerticalContentAlignment="Center"
IsChecked="{Binding Path=CheckedShadowSocks}">
<Label Content="{DynamicResource SSDesc}" FontSize="13" Foreground="Fuchsia" />
</CheckBox>
<Label Content="{DynamicResource SSDesc}" FontSize="13" Foreground="Fuchsia" />
</CheckBox>
<!--Trojan-->
<CheckBox Margin="0,15,0,0"
<!--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>
<Label Content="{DynamicResource TrojanDesc}" FontSize="13" Foreground="CadetBlue" />
</CheckBox>
<!--gRPC-->
<!--<CheckBox Content="VLESS gRPC&#x0a;基于http2多路复用。"
<!--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>
<!--************************** 参数 **************************-->
<StackPanel>
<!--Domain-->
<StackPanel Margin="30,15,0,0"
<!--Domain-->
<StackPanel Margin="30,15,0,0"
Orientation="Horizontal">
<Label Content="{DynamicResource XrayDomain}" Width="120" />
<TextBox Text="{Binding Path=Domain}" Width="200" />
</StackPanel>
<Label Content="{DynamicResource XrayDomain}" Width="120" />
<TextBox Text="{Binding Path=Domain}" Width="200" />
</StackPanel>
<!--Mask Domain-->
<StackPanel Margin="30,15,0,0"
<!--Mask Domain-->
<StackPanel Margin="30,15,0,0"
Orientation="Horizontal">
<Label Content="{DynamicResource XrayMarkDomain}" Width="120" />
<TextBox Text="{Binding Path=MaskDomain}" Width="200" />
</StackPanel>
<Label Content="{DynamicResource XrayMarkDomain}" Width="120" />
<TextBox Text="{Binding Path=MaskDomain}" Width="200" />
</StackPanel>
<!--UUID-->
<StackPanel Margin="30,10,0,0"
<!--UUID-->
<StackPanel Margin="30,10,0,0"
Orientation="Horizontal">
<Label Content="{DynamicResource XrayUUID}" Width="120" />
<Label Content="{DynamicResource XrayUUID}" Width="120" />
<TextBox Text="{Binding Path=UUID}"
<TextBox Text="{Binding Path=UUID}"
Width="200" />
<Button Margin="5,0,0,0"
<Button Margin="5,0,0,0"
Padding="12,3"
Command="{Binding Path=RandomUuid}"
Content="{DynamicResource Random}" />
</StackPanel>
</StackPanel>
<!--WebSocket Path-->
<StackPanel Margin="30,15,0,0"
<!--WebSocket Path-->
<StackPanel Margin="30,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}"
<Label Content="{DynamicResource VlessWsPath}" Foreground="LimeGreen" Width="120" />
<TextBox Text="{Binding Path=VLESS_WS_Path}"
Width="200" />
</StackPanel>
</StackPanel>
<!--seed-->
<StackPanel Margin="30,15,0,0"
<!--seed-->
<StackPanel Margin="30,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>
<Label Content="{DynamicResource VlessKcpSeed}" Foreground="LimeGreen" Width="120" />
<TextBox Text="{Binding Path=VLESS_KCP_Seed}" Width="200" />
</StackPanel>
<!--kcp type-->
<StackPanel Margin="30,15,0,0"
<!--kcp type-->
<StackPanel Margin="30,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"
<Label Content="{DynamicResource VlessKcpType}" Foreground="LimeGreen" Width="120" />
<ComboBox Width="200"
ItemsSource="{Binding Path=KcpTypes}"
SelectedValue="{Binding VLESS_KCP_Type,Mode=TwoWay}">
</ComboBox>
</StackPanel>
</ComboBox>
</StackPanel>
<!--kcp port-->
<StackPanel Margin="30,15,0,0"
<!--kcp port-->
<StackPanel Margin="30,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>
<Label Content="{DynamicResource VlessKcpPort}" Width="120" Foreground="LimeGreen" />
<TextBox Text="{Binding Path=VLESS_KCP_Port}" Width="200" />
</StackPanel>
<!--gRPC Port-->
<!--<StackPanel Margin="30,15,0,0"
<!--gRPC Port-->
<!--<StackPanel Margin="30,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Checked_VLESS_gRPC,
@ -181,8 +181,8 @@
<TextBox Text="{Binding Path=VLESS_gRPC_ServiceName}" Width="120" />
</StackPanel>-->
<!--Tcp Path-->
<!--<StackPanel Margin="30,15,0,0"
<!--Tcp Path-->
<!--<StackPanel Margin="30,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=Checked_VMESS_TCP,
@ -194,102 +194,124 @@
Width="200" />
</StackPanel>-->
<!--WebSocket Path-->
<StackPanel Margin="30,15,0,0"
<!--WebSocket Path-->
<StackPanel Margin="30,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}"
<Label Content="{DynamicResource VmessWsPath}" Foreground="Blue" Width="120" />
<TextBox Text="{Binding Path=VMESS_WS_Path}"
VerticalAlignment="Bottom"
Width="200" />
</StackPanel>
</StackPanel>
<!--seed-->
<StackPanel Margin="30,15,0,0"
<!--seed-->
<StackPanel Margin="30,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>
<Label Content="{DynamicResource VmessKcpSeed}" Foreground="Blue" Width="120" />
<TextBox Text="{Binding Path=VMESS_KCP_Seed}" Width="200" />
</StackPanel>
<!--kcp type-->
<StackPanel Margin="30,15,0,0"
<!--kcp type-->
<StackPanel Margin="30,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"
<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>
</ComboBox>
</StackPanel>
<!--kcp port-->
<StackPanel Margin="30,15,0,0"
<!--kcp port-->
<StackPanel Margin="30,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>
<Label Content="{DynamicResource VmessKcpPort}" Foreground="Blue" Width="120" />
<TextBox Text="{Binding Path=VMESS_KCP_Port}" Width="200" />
</StackPanel>
<!--ss密码-->
<StackPanel Margin="30,15,0,0"
<!--ss密码-->
<StackPanel Margin="30,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}"
<Label Content="{DynamicResource SSPassword}" Foreground="Fuchsia" Width="120" />
<TextBox Text="{Binding Path=ShadowSocksPassword}"
Width="200"/>
</StackPanel>
</StackPanel>
<!--ss加密方式-->
<StackPanel Margin="30,15,0,0"
<!--ss加密方式-->
<StackPanel Margin="30,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=CheckedShadowSocks,
Converter={StaticResource VisibleConverter}
}">
<Label Content="{DynamicResource SSMethods}" Foreground="Fuchsia" Width="120" />
<ComboBox Width="200"
<Label Content="{DynamicResource SSMethods}" Foreground="Fuchsia" Width="120" />
<ComboBox Width="200"
ItemsSource="{Binding ShadowSocksMethods}"
SelectedValue="{Binding ShadowSocksMethod}">
</ComboBox>
</StackPanel>
</ComboBox>
</StackPanel>
<!--ss端口-->
<StackPanel Margin="30,15,0,0"
Orientation="Horizontal"
Visibility="{
Binding Path=CheckedShadowSocks,
Converter={StaticResource VisibleConverter}
}">
<Label Content="{DynamicResource SSPort}" Foreground="Fuchsia" Width="120" />
<TextBox Text="{Binding Path=ShadowSocksPort}" Width="200"/>
</StackPanel>
<!--Trojan密码-->
<StackPanel Margin="30,15,0,0"
<!--Trojan密码-->
<StackPanel Margin="30,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}"
<Label Content="{DynamicResource TrojanPassword}" Foreground="CadetBlue" Width="120" />
<TextBox Text="{Binding Path=TrojanPassword}"
Width="200" />
</StackPanel>
<!--xray prot-->
<StackPanel Margin="30,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>
<!--Trojan端口-->
<StackPanel Margin="30,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="30,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

@ -85,7 +85,9 @@
<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="SSPort">SS Port</sys:String>
<sys:String x:Key="TrojanPassword">Trojan Pwd</sys:String>
<sys:String x:Key="TrojanPort">Trojan Port</sys:String>
<sys:String x:Key="XrayPort">xray Port</sys:String>
<sys:String x:Key="XrayPortDefault">default port is 443</sys:String>

View File

@ -84,7 +84,9 @@
<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="SSPort">SS端口</sys:String>
<sys:String x:Key="TrojanPassword">Trojan密碼</sys:String>
<sys:String x:Key="TrojanPort">Trojan端口</sys:String>
<sys:String x:Key="XrayPort">xray端口</sys:String>
<sys:String x:Key="XrayPortDefault">默認端口443不建議修改</sys:String>

View File

@ -85,7 +85,9 @@
<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="SSPort">SS端口</sys:String>
<sys:String x:Key="TrojanPassword">Trojan密码</sys:String>
<sys:String x:Key="TrojanPort">Trojan端口</sys:String>
<sys:String x:Key="XrayPort">xray端口</sys:String>
<sys:String x:Key="XrayPortDefault">默认端口443不建议修改</sys:String>