Forge
deeb25a2
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.WorkspaceHealthStripView"
6 Classes.power="{Binding UiModeFamily, Converter={StaticResource UiModeFamilyEq}, ConverterParameter=Power}"
7 x:DataType="vm:MainWindowViewModel">
8 <UserControl.Styles>
9 <Style Selector="StackPanel#TelemetryRoot">
10 <Setter Property="Margin" Value="8,4"/>
11 </Style>
12 <Style Selector="UserControl.power StackPanel#TelemetryRoot">
13 <Setter Property="Margin" Value="10,8,12,8"/>
14 </Style>
15 </UserControl.Styles>
16 <StackPanel x:Name="TelemetryRoot" Spacing="6">
17 <!-- Flight / non-Power: плоская полоса (Dark Cockpit — без карточки на каждый сегмент). -->
18 <Border Classes="ideHealthStrip"
19 IsVisible="{Binding UiModeFamily, Converter={StaticResource UiModeFamilyNe}, ConverterParameter=Power}">
20 <ItemsControl ItemsSource="{Binding IdeHealthSegments}">
21 <ItemsControl.ItemsPanel>
22 <ItemsPanelTemplate>
23 <StackPanel Orientation="Horizontal" Spacing="14"/>
24 </ItemsPanelTemplate>
25 </ItemsControl.ItemsPanel>
26 <ItemsControl.ItemTemplate>
27 <DataTemplate x:DataType="cockpitWh:IdeHealthSegment">
28 <TextBlock Classes="ideHealthSegment" Text="{Binding LineText}"/>
29 </DataTemplate>
30 </ItemsControl.ItemTemplate>
31 </ItemsControl>
32 </Border>
33
34 <!-- Power: кокпит — одна «SOC»-полоса + компактный JSON -->
35 <Border IsVisible="{Binding UiModeFamily, Converter={StaticResource UiModeFamilyEq}, ConverterParameter=Power}"
36 Background="{DynamicResource CascadeTheme.PowerWorkspaceHealthStripBackground}"
37 BorderBrush="{DynamicResource CascadeTheme.PowerNeonBorder}"
38 BorderThickness="1"
39 CornerRadius="14"
40 Padding="12,10"
41 BoxShadow="0 0 36 0 #6600E5FF, 0 0 56 0 #448A65FF, 0 6 28 0 #48000000">
42 <StackPanel Spacing="8">
43 <Grid ColumnDefinitions="*,Auto"
44 RowDefinitions="Auto">
45 <ItemsControl Grid.Column="0"
46 ItemsSource="{Binding IdeHealthSegments}"
47 HorizontalAlignment="Left">
48 <ItemsControl.ItemsPanel>
49 <ItemsPanelTemplate>
50 <StackPanel Orientation="Horizontal" Spacing="8"/>
51 </ItemsPanelTemplate>
52 </ItemsControl.ItemsPanel>
53 <ItemsControl.ItemTemplate>
54 <DataTemplate x:DataType="cockpitWh:IdeHealthSegment">
55 <Panel>
56 <Border IsVisible="{Binding IsBuildSource}"
57 Margin="0,0,8,0"
58 Padding="10,6"
59 CornerRadius="6"
60 Background="{DynamicResource CascadeTheme.PowerCockpitPanelBackground}"
61 BorderBrush="{DynamicResource CascadeTheme.PowerNeonAccent}"
62 BorderThickness="1">
63 <StackPanel Orientation="Horizontal" Spacing="8">
64 <Panel VerticalAlignment="Center">
65 <TextBlock Text="●" FontSize="12" Foreground="#FF6B8A" IsVisible="{Binding IsBuildRunning}"/>
66 <TextBlock Text="●" FontSize="12" Foreground="#2D8A5A" IsVisible="{Binding !IsBuildRunning}"/>
67 </Panel>
68 <TextBlock Text="{Binding CockpitShort}"
69 FontWeight="Bold"
70 FontSize="12"
71 Foreground="{DynamicResource CascadeTheme.ToolbarTextForeground}"/>
72 </StackPanel>
73 </Border>
74 <Border IsVisible="{Binding !IsBuildSource}"
75 Margin="0,0,8,0"
76 Padding="10,6"
77 CornerRadius="6"
78 Background="{DynamicResource CascadeTheme.PowerCockpitPanelBackground}"
79 BorderBrush="{DynamicResource CascadeTheme.PowerNeonBorder}"
80 BorderThickness="1"
81 MaxWidth="220">
82 <TextBlock Text="{Binding CockpitShort}"
83 TextTrimming="CharacterEllipsis"
84 FontSize="11"
85 MaxWidth="200"
86 Foreground="{DynamicResource CascadeTheme.ToolbarTextForeground}"/>
87 </Border>
88 </Panel>
89 </DataTemplate>
90 </ItemsControl.ItemTemplate>
91 </ItemsControl>
92 <TextBlock Grid.Column="1"
93 Text="WORKSPACE"
94 FontSize="10"
95 FontWeight="SemiBold"
96 Opacity="0.75"
97 VerticalAlignment="Center"
98 HorizontalAlignment="Right"
99 Foreground="{DynamicResource CascadeTheme.ChatLabelForeground}"/>
100 </Grid>
101
102 <Grid ColumnDefinitions="Auto,*" RowDefinitions="Auto,*">
103 <Button Grid.Row="0" Grid.Column="0"
104 Content="Обновить снимок"
105 Command="{Binding RefreshWorkspaceSnapshotCommand}"
106 VerticalAlignment="Top"
107 Margin="0,0,8,0"
108 Padding="10,4"/>
109 <ScrollViewer Grid.Row="0" Grid.RowSpan="2" Grid.Column="1"
110 MaxHeight="100"
111 VerticalScrollBarVisibility="Auto"
112 HorizontalScrollBarVisibility="Disabled">
113 <TextBox Text="{Binding WorkspaceSnapshotJson, Mode=OneWay}"
114 IsReadOnly="True"
115 TextWrapping="Wrap"
116 FontFamily="Consolas,monospace"
117 FontSize="10"
118 MinHeight="40"
119 Background="Transparent"
120 Foreground="{DynamicResource CascadeTheme.ToolbarTextForeground}"
121 BorderThickness="0"/>
122 </ScrollViewer>
123 </Grid>
124 </StackPanel>
125 </Border>
126 </StackPanel>
127</UserControl>
128
View only · write via MCP/CIDE