| 1 | <UserControl xmlns="https://github.com/avaloniaui" |
| 2 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 3 | xmlns:vm="using:CascadeIDE.ViewModels" |
| 4 | xmlns:models="using:CascadeIDE.Models" |
| 5 | xmlns:views="using:CascadeIDE.Views" |
| 6 | x:Class="CascadeIDE.Views.GitMfdPageView" |
| 7 | x:DataType="vm:MainWindowViewModel"> |
| 8 | <Grid DataContext="{Binding GitPanel}" |
| 9 | ColumnDefinitions="280,4,*" RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,*,Auto,120,Auto,Auto,Auto"> |
| 10 | <TextBlock Grid.Row="0" Grid.ColumnSpan="3" |
| 11 | Text="{Binding GitBranchLine, StringFormat=Ветка / состояние: {0}}" |
| 12 | Foreground="{DynamicResource CascadeTheme.ToolbarTextForeground}" |
| 13 | FontSize="11" |
| 14 | Margin="0,0,0,4"/> |
| 15 | <TextBlock Grid.Row="1" Grid.ColumnSpan="3" |
| 16 | Text="{Binding GitRepositoryContextText}" |
| 17 | Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}" |
| 18 | FontSize="10" |
| 19 | TextWrapping="Wrap" |
| 20 | Margin="0,0,0,4"/> |
| 21 | <TextBlock Grid.Row="2" Grid.ColumnSpan="3" |
| 22 | Text="{Binding GitPanelStatusText}" |
| 23 | Foreground="#FFAA6666" |
| 24 | FontSize="11" |
| 25 | TextWrapping="Wrap" |
| 26 | Margin="0,0,0,4"/> |
| 27 | <TextBlock Grid.Row="3" Grid.ColumnSpan="3" |
| 28 | TextWrapping="Wrap" |
| 29 | FontSize="10" |
| 30 | Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}" |
| 31 | Margin="0,0,0,6" |
| 32 | Text="Submodule: путь из .gitmodules — [sm]. Gitlink в родителе vs коммит внутри submodule. «Открыть решение» — .sln/.slnx в submodule (корень или подпапка 1-го уровня); контекст IDE переключится на этот репозиторий."/> |
| 33 | <StackPanel Grid.Row="4" Grid.ColumnSpan="3" Orientation="Horizontal" Spacing="6" Margin="0,0,0,4"> |
| 34 | <Button Content="Submodule update --init" Command="{Binding GitSubmoduleUpdateInitCommand}" Padding="8,4" ToolTip.Tip="git submodule update --init --recursive (из корня текущего репо)"/> |
| 35 | <Button Content="Submodule sync" Command="{Binding GitSubmoduleSyncCommand}" Padding="8,4" ToolTip.Tip="git submodule sync --recursive"/> |
| 36 | <Button Content="Открыть решение в submodule" Command="{Binding OpenSubmoduleSolutionInIdeCommand}" Padding="8,4" ToolTip.Tip="Найти .slnx/.sln в выбранной строке [sm] и открыть как текущее решение"/> |
| 37 | </StackPanel> |
| 38 | <ScrollViewer Grid.Row="5" Grid.ColumnSpan="3" VerticalScrollBarVisibility="Auto" MaxHeight="80" Margin="0,0,0,6"> |
| 39 | <TextBox Text="{Binding GitSubmoduleCommandOutput, Mode=OneWay}" |
| 40 | IsReadOnly="True" |
| 41 | TextWrapping="Wrap" |
| 42 | FontFamily="Consolas,monospace" |
| 43 | FontSize="9" |
| 44 | Background="Transparent" |
| 45 | Foreground="{DynamicResource CascadeTheme.TerminalForeground}" |
| 46 | BorderThickness="0" |
| 47 | PlaceholderText="Вывод submodule update / sync…"/> |
| 48 | </ScrollViewer> |
| 49 | <Border Grid.Row="6" Grid.Column="0" BorderBrush="{DynamicResource CascadeTheme.EditorColumnBorderBrush}" BorderThickness="1" Padding="4"> |
| 50 | <DockPanel> |
| 51 | <StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Spacing="6" Margin="0,0,0,4"> |
| 52 | <Button Content="Обновить" Command="{Binding RefreshGitPanelCommand}" Padding="8,4"/> |
| 53 | <Button Content="В индекс" Command="{Binding StageGitSelectionCommand}" Padding="8,4" ToolTip.Tip="git add — выбранный путь"/> |
| 54 | <Button Content="Снять из индекса" Command="{Binding UnstageGitSelectionCommand}" Padding="8,4" ToolTip.Tip="git restore --staged — выбранный путь"/> |
| 55 | <Button Content="Папка submodule" Command="{Binding OpenSubmoduleFolderCommand}" Padding="8,4" ToolTip.Tip="Открыть каталог выбранного submodule в проводнике"/> |
| 56 | </StackPanel> |
| 57 | <ListBox ItemsSource="{Binding GitStatusRows}" |
| 58 | SelectedItem="{Binding SelectedGitStatusRow}" |
| 59 | Background="Transparent" |
| 60 | MinHeight="80"> |
| 61 | <ListBox.ItemTemplate> |
| 62 | <DataTemplate DataType="models:GitStatusRow"> |
| 63 | <StackPanel Orientation="Horizontal" Spacing="4"> |
| 64 | <TextBlock Text="[sm]" |
| 65 | FontSize="10" |
| 66 | Foreground="#FF9B7DFF" |
| 67 | VerticalAlignment="Center" |
| 68 | IsVisible="{Binding IsSubmodulePath}"/> |
| 69 | <TextBlock Text="{Binding RawLine}" |
| 70 | FontFamily="Consolas,monospace" |
| 71 | FontSize="11" |
| 72 | Foreground="{DynamicResource CascadeTheme.TerminalForeground}" |
| 73 | TextWrapping="NoWrap"/> |
| 74 | </StackPanel> |
| 75 | </DataTemplate> |
| 76 | </ListBox.ItemTemplate> |
| 77 | </ListBox> |
| 78 | </DockPanel> |
| 79 | </Border> |
| 80 | <GridSplitter Grid.Row="6" Grid.Column="1" Width="4" ResizeDirection="Columns" |
| 81 | Background="{DynamicResource CascadeTheme.BuildOutputBorderBrush}" |
| 82 | IsEnabled="{Binding $parent[UserControl].DataContext.WorkspaceSplittersUnlocked}"/> |
| 83 | <ScrollViewer Grid.Row="6" Grid.Column="2" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"> |
| 84 | <TextBox Text="{Binding GitDiffText, Mode=OneWay}" |
| 85 | IsReadOnly="True" |
| 86 | TextWrapping="NoWrap" |
| 87 | FontFamily="Consolas,monospace" |
| 88 | FontSize="11" |
| 89 | Background="{DynamicResource CascadeTheme.BuildOutputBackground}" |
| 90 | Foreground="{DynamicResource CascadeTheme.TerminalForeground}" |
| 91 | BorderThickness="0" |
| 92 | PlaceholderText="Выберите строку статуса слева — покажется diff."/> |
| 93 | </ScrollViewer> |
| 94 | <views:PanelChromeHeader Grid.Row="7" Grid.ColumnSpan="3" Classes="terminal" Title="git submodule status" UppercaseTitle="True" Margin="0,8,0,0"/> |
| 95 | <ScrollViewer Grid.Row="8" Grid.ColumnSpan="3" VerticalScrollBarVisibility="Auto"> |
| 96 | <TextBox Text="{Binding GitSubmoduleStatusText, Mode=OneWay}" |
| 97 | IsReadOnly="True" |
| 98 | TextWrapping="Wrap" |
| 99 | FontFamily="Consolas,monospace" |
| 100 | FontSize="10" |
| 101 | Background="Transparent" |
| 102 | Foreground="{DynamicResource CascadeTheme.TerminalForeground}" |
| 103 | BorderThickness="0"/> |
| 104 | </ScrollViewer> |
| 105 | <views:PanelChromeHeader Grid.Row="9" Grid.ColumnSpan="3" Classes="terminal" Title="Сообщение коммита" UppercaseTitle="True" Margin="0,4,0,0"/> |
| 106 | <TextBox Grid.Row="10" Grid.ColumnSpan="3" |
| 107 | Text="{Binding GitCommitMessage, Mode=TwoWay}" |
| 108 | PlaceholderText="Сообщение коммита" |
| 109 | FontFamily="Consolas,monospace" |
| 110 | FontSize="12" |
| 111 | MinHeight="36" |
| 112 | AcceptsReturn="True" |
| 113 | TextWrapping="Wrap"/> |
| 114 | <StackPanel Grid.Row="11" Grid.ColumnSpan="3" Orientation="Horizontal" Spacing="8" Margin="0,8,0,0"> |
| 115 | <Button Content="Коммит (add -A)" Command="{Binding CommitGitFromPanelCommand}" Padding="12,6" ToolTip.Tip="git add -A и commit — как MCP ide_git_commit"/> |
| 116 | <Button Content="Коммит (только staged)" Command="{Binding CommitGitStagedOnlyCommand}" Padding="12,6" ToolTip.Tip="git commit без add — только то, что в индексе"/> |
| 117 | <Button Content="Push" Command="{Binding PushGitFromPanelCommand}" Padding="12,6"/> |
| 118 | </StackPanel> |
| 119 | </Grid> |
| 120 | </UserControl> |
| 121 | |