|
| 1 | +<UserControl xmlns="https://github.com/avaloniaui" |
| 2 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 3 | + xmlns:vm="using:GeneralUpdate.Tools.ViewModels" |
| 4 | + xmlns:svc="using:GeneralUpdate.Tools.Services" |
| 5 | + x:Class="GeneralUpdate.Tools.Views.SimulateView" |
| 6 | + x:DataType="vm:SimulateViewModel"> |
| 7 | + <ScrollViewer> |
| 8 | + <StackPanel Margin="28,24" Spacing="14"> |
| 9 | + <TextBlock Text="🧪 Simulate Update" FontSize="20" FontWeight="Bold"/> |
| 10 | + |
| 11 | + <!-- Test target --> |
| 12 | + <Border Padding="16" CornerRadius="8" Background="{DynamicResource SystemControlBackgroundChromeMediumBrush}"> |
| 13 | + <StackPanel Spacing="10"> |
| 14 | + <TextBlock Text="Test Target" FontSize="14" FontWeight="SemiBold"/> |
| 15 | + <Grid ColumnDefinitions="Auto,*,Auto"> |
| 16 | + <TextBlock Grid.Column="0" Text="Old App Dir" VerticalAlignment="Center" Width="100"/> |
| 17 | + <TextBox Grid.Column="1" Text="{Binding Config.AppDirectory}" IsReadOnly="True" Margin="8,0"/> |
| 18 | + <Button Grid.Column="2" Content="📁 Select" Command="{Binding SelectAppDirCommand}" MinWidth="80"/> |
| 19 | + </Grid> |
| 20 | + <Grid ColumnDefinitions="Auto,*,Auto"> |
| 21 | + <TextBlock Grid.Column="0" Text="Patch Package" VerticalAlignment="Center" Width="100"/> |
| 22 | + <TextBox Grid.Column="1" Text="{Binding Config.PatchFilePath}" IsReadOnly="True" Margin="8,0"/> |
| 23 | + <Button Grid.Column="2" Content="📁 Select" Command="{Binding SelectPatchCommand}" MinWidth="80"/> |
| 24 | + </Grid> |
| 25 | + </StackPanel> |
| 26 | + </Border> |
| 27 | + |
| 28 | + <!-- Config --> |
| 29 | + <Border Padding="16" CornerRadius="8" Background="{DynamicResource SystemControlBackgroundChromeMediumBrush}"> |
| 30 | + <StackPanel Spacing="10"> |
| 31 | + <TextBlock Text="Update Config" FontSize="14" FontWeight="SemiBold"/> |
| 32 | + <Grid ColumnDefinitions="Auto,*,Auto,*"> |
| 33 | + <TextBlock Grid.Column="0" Text="Current Ver" VerticalAlignment="Center"/> |
| 34 | + <TextBox Grid.Column="1" Text="{Binding Config.CurrentVersion}" Margin="8,0,16,0"/> |
| 35 | + <TextBlock Grid.Column="2" Text="Target Ver" VerticalAlignment="Center"/> |
| 36 | + <TextBox Grid.Column="3" Text="{Binding Config.TargetVersion}" Margin="8,0"/> |
| 37 | + </Grid> |
| 38 | + <Grid ColumnDefinitions="Auto,*,Auto,*"> |
| 39 | + <TextBlock Grid.Column="0" Text="Platform" VerticalAlignment="Center"/> |
| 40 | + <ComboBox Grid.Column="1" ItemsSource="{Binding Platforms}" |
| 41 | + SelectedItem="{Binding Config.Platform}" Margin="8,0,16,0"/> |
| 42 | + <TextBlock Grid.Column="2" Text="AppType" VerticalAlignment="Center"/> |
| 43 | + <ComboBox Grid.Column="3" ItemsSource="{Binding AppTypes}" |
| 44 | + SelectedItem="{Binding Config.AppType}" Margin="8,0"/> |
| 45 | + </Grid> |
| 46 | + <Grid ColumnDefinitions="Auto,*"> |
| 47 | + <TextBlock Grid.Column="0" Text="AppSecret" VerticalAlignment="Center"/> |
| 48 | + <TextBox Grid.Column="1" Text="{Binding Config.AppSecretKey}" Margin="8,0"/> |
| 49 | + </Grid> |
| 50 | + <Grid ColumnDefinitions="Auto,*"> |
| 51 | + <TextBlock Grid.Column="0" Text="Product ID" VerticalAlignment="Center"/> |
| 52 | + <TextBox Grid.Column="1" Text="{Binding Config.ProductId}" Margin="8,0"/> |
| 53 | + </Grid> |
| 54 | + </StackPanel> |
| 55 | + </Border> |
| 56 | + |
| 57 | + <!-- Output --> |
| 58 | + <Border Padding="16" CornerRadius="8" Background="{DynamicResource SystemControlBackgroundChromeMediumBrush}"> |
| 59 | + <StackPanel Spacing="10"> |
| 60 | + <TextBlock Text="Output" FontSize="14" FontWeight="SemiBold"/> |
| 61 | + <Grid ColumnDefinitions="Auto,*,Auto"> |
| 62 | + <TextBlock Grid.Column="0" Text="Simulate Dir" VerticalAlignment="Center" Width="100"/> |
| 63 | + <TextBox Grid.Column="1" Text="{Binding Config.OutputDirectory}" IsReadOnly="True" Margin="8,0"/> |
| 64 | + <Button Grid.Column="2" Content="📁 Select" Command="{Binding SelectOutputDirCommand}" MinWidth="80"/> |
| 65 | + </Grid> |
| 66 | + </StackPanel> |
| 67 | + </Border> |
| 68 | + |
| 69 | + <!-- Run --> |
| 70 | + <Button Content="🚀 Start Simulation" Command="{Binding StartSimulationCommand}" |
| 71 | + IsEnabled="{Binding !IsRunning}" Height="40" FontSize="14" HorizontalAlignment="Stretch"/> |
| 72 | + <TextBlock Text="{Binding Status}" FontSize="13"/> |
| 73 | + |
| 74 | + <!-- Log --> |
| 75 | + <Border Padding="10" CornerRadius="6" Background="{DynamicResource SystemControlBackgroundChromeMediumLowBrush}" MaxHeight="200"> |
| 76 | + <ListBox ItemsSource="{Binding Log}" Background="Transparent" BorderThickness="0"> |
| 77 | + <ListBox.ItemTemplate> |
| 78 | + <DataTemplate><TextBlock Text="{Binding}" FontSize="11" FontFamily="Consolas,monospace"/></DataTemplate> |
| 79 | + </ListBox.ItemTemplate> |
| 80 | + </ListBox> |
| 81 | + </Border> |
| 82 | + </StackPanel> |
| 83 | + </ScrollViewer> |
| 84 | +</UserControl> |
0 commit comments