| 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:cockpitWh="using:CascadeIDE.Cockpit.Channels.WorkspaceHealth" |
| 5 | x:Class="CascadeIDE.Views.WorkspaceHealthMfdPageView" |
| 6 | Classes.power="{Binding UiModeFamily, Converter={StaticResource UiModeFamilyEq}, ConverterParameter=Power}" |
| 7 | x:DataType="vm:MainWindowViewModel"> |
| 8 | <Border Classes="ideHealthStrip" |
| 9 | Margin="0,0,0,8" |
| 10 | Padding="8,8,8,10"> |
| 11 | <Grid RowDefinitions="Auto,*"> |
| 12 | <TextBlock Grid.Row="0" |
| 13 | Text="WORKSPACE" |
| 14 | FontSize="10" |
| 15 | FontWeight="SemiBold" |
| 16 | Opacity="0.75" |
| 17 | Margin="0,0,0,8" |
| 18 | Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/> |
| 19 | <!-- Flight / non-Power: плоский список (Dark Cockpit — без карточки на сегмент). --> |
| 20 | <ScrollViewer Grid.Row="1" |
| 21 | MaxHeight="320" |
| 22 | VerticalScrollBarVisibility="Auto" |
| 23 | HorizontalScrollBarVisibility="Disabled" |
| 24 | IsVisible="{Binding UiModeFamily, Converter={StaticResource UiModeFamilyNe}, ConverterParameter=Power}"> |
| 25 | <ItemsControl ItemsSource="{Binding IdeHealthSegments}"> |
| 26 | <ItemsControl.ItemTemplate> |
| 27 | <DataTemplate x:DataType="cockpitWh:IdeHealthSegment"> |
| 28 | <TextBlock Classes="ideHealthSegment" |
| 29 | Text="{Binding LineText}" |
| 30 | TextWrapping="Wrap" |
| 31 | Margin="0,0,0,10"/> |
| 32 | </DataTemplate> |
| 33 | </ItemsControl.ItemTemplate> |
| 34 | </ItemsControl> |
| 35 | </ScrollViewer> |
| 36 | <!-- Power: компактный кокпит + снимок --> |
| 37 | <ScrollViewer Grid.Row="1" |
| 38 | MaxHeight="360" |
| 39 | VerticalScrollBarVisibility="Auto" |
| 40 | HorizontalScrollBarVisibility="Disabled" |
| 41 | IsVisible="{Binding UiModeFamily, Converter={StaticResource UiModeFamilyEq}, ConverterParameter=Power}"> |
| 42 | <StackPanel Spacing="8"> |
| 43 | <ItemsControl ItemsSource="{Binding IdeHealthSegments}"> |
| 44 | <ItemsControl.ItemTemplate> |
| 45 | <DataTemplate x:DataType="cockpitWh:IdeHealthSegment"> |
| 46 | <Panel Margin="0,0,0,6"> |
| 47 | <Border IsVisible="{Binding IsBuildSource}" |
| 48 | Padding="8,6" |
| 49 | CornerRadius="6" |
| 50 | Background="{DynamicResource CascadeTheme.PowerCockpitPanelBackground}" |
| 51 | BorderBrush="{DynamicResource CascadeTheme.PowerNeonAccent}" |
| 52 | BorderThickness="1"> |
| 53 | <StackPanel Orientation="Horizontal" Spacing="8"> |
| 54 | <Panel VerticalAlignment="Center"> |
| 55 | <TextBlock Text="●" FontSize="12" Foreground="#FF6B8A" IsVisible="{Binding IsBuildRunning}"/> |
| 56 | <TextBlock Text="●" FontSize="12" Foreground="#2D8A5A" IsVisible="{Binding !IsBuildRunning}"/> |
| 57 | </Panel> |
| 58 | <TextBlock Text="{Binding CockpitShort}" |
| 59 | FontWeight="Bold" |
| 60 | FontSize="12" |
| 61 | Foreground="{DynamicResource CascadeTheme.ToolbarTextForeground}"/> |
| 62 | </StackPanel> |
| 63 | </Border> |
| 64 | <Border IsVisible="{Binding !IsBuildSource}" |
| 65 | Padding="8,6" |
| 66 | CornerRadius="6" |
| 67 | Background="{DynamicResource CascadeTheme.PowerCockpitPanelBackground}" |
| 68 | BorderBrush="{DynamicResource CascadeTheme.PowerNeonBorder}" |
| 69 | BorderThickness="1"> |
| 70 | <TextBlock Text="{Binding CockpitShort}" |
| 71 | TextWrapping="Wrap" |
| 72 | FontSize="11" |
| 73 | Foreground="{DynamicResource CascadeTheme.ToolbarTextForeground}"/> |
| 74 | </Border> |
| 75 | </Panel> |
| 76 | </DataTemplate> |
| 77 | </ItemsControl.ItemTemplate> |
| 78 | </ItemsControl> |
| 79 | <Button Content="Обновить снимок" |
| 80 | Command="{Binding RefreshWorkspaceSnapshotCommand}" |
| 81 | HorizontalAlignment="Left" |
| 82 | Padding="10,4"/> |
| 83 | <TextBox Text="{Binding WorkspaceSnapshotJson, Mode=OneWay}" |
| 84 | IsReadOnly="True" |
| 85 | TextWrapping="Wrap" |
| 86 | FontFamily="Consolas,monospace" |
| 87 | FontSize="10" |
| 88 | MinHeight="48" |
| 89 | MaxHeight="140" |
| 90 | Background="Transparent" |
| 91 | Foreground="{DynamicResource CascadeTheme.ToolbarTextForeground}" |
| 92 | BorderThickness="1" |
| 93 | BorderBrush="{DynamicResource CascadeTheme.PowerNeonBorder}"/> |
| 94 | </StackPanel> |
| 95 | </ScrollViewer> |
| 96 | </Grid> |
| 97 | </Border> |
| 98 | </UserControl> |
| 99 | |