| 1 | <views:PointerTrackingWindow 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.InstallModelDialog" |
| 7 | x:Name="ThisDialog" |
| 8 | x:DataType="vm:InstallModelDialogViewModel" |
| 9 | Title="Установить модель Ollama" |
| 10 | Width="420" Height="380" |
| 11 | Background="#F5F5F5" |
| 12 | WindowStartupLocation="CenterOwner"> |
| 13 | |
| 14 | <StackPanel Margin="16" Spacing="12"> |
| 15 | <TextBlock Text="Recommended (по конфигурации ПК)" FontWeight="SemiBold" Foreground="#1A1A1A"/> |
| 16 | <ScrollViewer MaxHeight="140" VerticalScrollBarVisibility="Auto"> |
| 17 | <ItemsControl ItemsSource="{Binding RecommendedModels}"> |
| 18 | <ItemsControl.ItemTemplate> |
| 19 | <DataTemplate DataType="models:RecommendedModel"> |
| 20 | <Button Content="{Binding Description}" |
| 21 | Tapped="OnRecommendedItemTapped" |
| 22 | HorizontalAlignment="Stretch" |
| 23 | HorizontalContentAlignment="Left" |
| 24 | Margin="0,2" |
| 25 | Padding="8,4" |
| 26 | Background="#E8E8E8" |
| 27 | Foreground="#1A1A1A"/> |
| 28 | </DataTemplate> |
| 29 | </ItemsControl.ItemTemplate> |
| 30 | </ItemsControl> |
| 31 | </ScrollViewer> |
| 32 | <TextBlock Text="Или введите имя модели:" Foreground="#333"/> |
| 33 | <TextBox Text="{Binding CustomModelName, Mode=TwoWay}" |
| 34 | PlaceholderText="Например: qwen2.5-coder:7b" |
| 35 | IsEnabled="{Binding !IsPulling}"/> |
| 36 | <StackPanel Orientation="Horizontal" Spacing="8"> |
| 37 | <Button Content="Установить" Command="{Binding InstallCommand}" Background="#4CAF50" Foreground="White" Padding="12,6"/> |
| 38 | <Button Content="Отмена" Command="{Binding CancelCommand}" Background="#E0E0E0" Foreground="#1A1A1A" Padding="12,6"/> |
| 39 | </StackPanel> |
| 40 | <TextBlock Text="{Binding ProgressText}" Foreground="#666" FontSize="11" TextWrapping="Wrap"/> |
| 41 | <TextBlock Text="{Binding ErrorText}" Foreground="#C00" FontSize="11" TextWrapping="Wrap"/> |
| 42 | </StackPanel> |
| 43 | </views:PointerTrackingWindow> |
| 44 | |