1
0
mirror of https://github.com/proxysu/ProxySU.git synced 2024-11-27 23:56:07 +03:00

update...

This commit is contained in:
proxysu 2021-11-27 11:47:31 +08:00
parent 8bc507ef43
commit eaca464f9c
5 changed files with 36 additions and 4 deletions

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

@ -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;