forked from proxysu/ProxySU
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b79a7c
commit eeada87
Showing
13 changed files
with
229 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using MvvmCross.Commands; | ||
using MvvmCross.Navigation; | ||
using MvvmCross.ViewModels; | ||
using ProxySuper.Core.Models; | ||
using ProxySuper.Core.Models.Hosts; | ||
using ProxySuper.Core.Models.Projects; | ||
using ProxySuper.Core.Services; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace ProxySuper.Core.ViewModels | ||
{ | ||
public class TrojanGoEditorViewModel : MvxViewModel<Record, Record> | ||
{ | ||
public TrojanGoEditorViewModel(IMvxNavigationService navigationService) | ||
{ | ||
NavigationService = navigationService; | ||
} | ||
|
||
public IMvxNavigationService NavigationService { get; } | ||
|
||
public IMvxCommand SaveCommand => new MvxCommand(Save); | ||
|
||
public string Id { get; set; } | ||
|
||
public Host Host { get; set; } | ||
|
||
public TrojanGoSettings Settings { get; set; } | ||
|
||
public override void Prepare(Record parameter) | ||
{ | ||
var record = Utils.DeepClone(parameter); | ||
|
||
Id = record.Id; | ||
Host = record.Host; | ||
Settings = record.TrojanGoSettings; | ||
} | ||
|
||
private void Save() | ||
{ | ||
NavigationService.Close(this, new Record | ||
{ | ||
Id = this.Id, | ||
Host = this.Host, | ||
TrojanGoSettings = Settings, | ||
}); | ||
} | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<views:MvxWindow x:Class="ProxySuper.WPF.Views.TrojanGoEditorView" | ||
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:views="clr-namespace:MvvmCross.Platforms.Wpf.Views;assembly=MvvmCross.Platforms.Wpf" | ||
xmlns:local="clr-namespace:ProxySuper.WPF.Views" | ||
xmlns:ctrl="clr-namespace:ProxySuper.WPF.Controls" | ||
mc:Ignorable="d" | ||
BorderThickness="0,1,0,0" | ||
BorderBrush="#eee" | ||
WindowStartupLocation="CenterScreen" | ||
Title="Trojan-Go" Height="600" Width="1000"> | ||
<Grid> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="310" /> | ||
<ColumnDefinition Width="1" /> | ||
<ColumnDefinition Width="*" /> | ||
</Grid.ColumnDefinitions> | ||
|
||
<StackPanel Grid.Column="0" Margin="10"> | ||
<ctrl:HostControl /> | ||
</StackPanel> | ||
<StackPanel Grid.Column="1" Background="#EEE"></StackPanel> | ||
|
||
<StackPanel Grid.Column="2"> | ||
<Grid Margin="10"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="36" /> | ||
<RowDefinition Height="36" /> | ||
<RowDefinition Height="36" /> | ||
<RowDefinition Height="36" /> | ||
<RowDefinition Height="36" /> | ||
</Grid.RowDefinitions> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="80" /> | ||
<ColumnDefinition Width="200" /> | ||
</Grid.ColumnDefinitions> | ||
|
||
<Label Content="域名" Grid.Row="0" Grid.Column="0" /> | ||
<TextBox Text="{Binding Settings.Domain}" Grid.Row="0" Grid.Column="1" /> | ||
|
||
<Label Content="端口" Grid.Row="1" Grid.Column="0" /> | ||
<TextBox Text="{Binding Settings.Port}" Grid.Row="1" Grid.Column="1" /> | ||
|
||
<Label Content="密码" Grid.Row="2" Grid.Column="0" /> | ||
<TextBox Text="{Binding Settings.Password}" Grid.Row="2" Grid.Column="1" /> | ||
|
||
<Label Content="伪装域名" Grid.Row="3" Grid.Column="0" /> | ||
<TextBox Text="{Binding Settings.MaskDomain}" Grid.Row="3" Grid.Column="1" /> | ||
</Grid> | ||
|
||
<Border BorderBrush="#eee" BorderThickness="0,1,0,0"> | ||
<Button Content="{DynamicResource Save}" | ||
Command="{Binding SaveCommand}" | ||
HorizontalAlignment="Right" | ||
VerticalAlignment="Center" | ||
Height="30" | ||
Width="100" | ||
Margin="40,20" /> | ||
</Border> | ||
</StackPanel> | ||
</Grid> | ||
</views:MvxWindow> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using MvvmCross.Platforms.Wpf.Presenters.Attributes; | ||
using MvvmCross.Platforms.Wpf.Views; | ||
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 ProxySuper.WPF.Views | ||
{ | ||
/// <summary> | ||
/// TrojanEditorView.xaml 的交互逻辑 | ||
/// </summary> | ||
[MvxWindowPresentation(Identifier = nameof(XrayEditorView), Modal = true)] | ||
public partial class TrojanGoEditorView : MvxWindow | ||
{ | ||
public TrojanGoEditorView() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.