Multi-Platform Package Manager for Stable Diffusion
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

182 lines
9.7 KiB

<controls:UserControlBase xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:StabilityMatrix.Avalonia.Controls"
xmlns:designData="clr-namespace:StabilityMatrix.Avalonia.DesignData"
xmlns:lang="clr-namespace:StabilityMatrix.Avalonia.Languages"
xmlns:avalonia="clr-namespace:FluentIcons.Avalonia;assembly=FluentIcons.Avalonia"
xmlns:controls1="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:models="clr-namespace:StabilityMatrix.Core.Models;assembly=StabilityMatrix.Core"
xmlns:database="clr-namespace:StabilityMatrix.Core.Models.Database;assembly=StabilityMatrix.Core"
xmlns:packageManager="clr-namespace:StabilityMatrix.Avalonia.ViewModels.PackageManager"
xmlns:labs="clr-namespace:Avalonia.Labs.Controls;assembly=Avalonia.Labs.Controls"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:DataType="packageManager:PackageInstallDetailViewModel"
x:CompileBindings="True"
d:DataContext="{x:Static designData:DesignData.PackageInstallDetailViewModel}"
x:Class="StabilityMatrix.Avalonia.Views.PackageManager.PackageInstallDetailView">
<Grid ColumnDefinitions="Auto, *"
RowDefinitions="Auto, *">
<controls:BetterAdvancedImage
Height="300"
Width="300"
VerticalAlignment="Top"
Stretch="UniformToFill"
Margin="16, 16, 8, 8"
CornerRadius="8"
Source="{Binding SelectedPackage.PreviewImageUri}">
</controls:BetterAdvancedImage>
<StackPanel Grid.Row="0" Grid.Column="1"
Margin="8"
Orientation="Vertical">
<controls:HyperlinkIconButton NavigateUri="{Binding SelectedPackage.LicenseUrl}"
Content="{Binding SelectedPackage.LicenseType}" />
<ToggleSwitch OnContent="{x:Static lang:Resources.Label_Releases}"
OffContent="{x:Static lang:Resources.Label_Branches}"
IsVisible="{Binding ShowReleaseMode}"
IsChecked="{Binding IsReleaseMode}"
Margin="8,0,8,8" />
<!-- Version Selector -->
<Label Margin="8,0"
FontSize="14"
FontWeight="Light"
Content="{Binding ReleaseLabelText}" />
<controls1:FAComboBox
ItemsSource="{Binding AvailableVersions}"
MinWidth="250"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
FontSize="16"
Margin="8,0,8,8"
SelectedItem="{Binding SelectedVersion}">
<controls1:FAComboBox.ItemTemplate>
<DataTemplate DataType="{x:Type models:PackageVersion}">
<TextBlock
Name="NameTextBlock"
VerticalAlignment="Center"
Text="{Binding TagName}" />
</DataTemplate>
</controls1:FAComboBox.ItemTemplate>
</controls1:FAComboBox>
<Label Margin="8,0"
FontSize="14"
FontWeight="Light"
ToolTip.Tip="This will also be the folder name"
Content="{x:Static lang:Resources.Label_DisplayName}" />
<TextBox MinWidth="250"
Margin="8,0"
FontSize="16"
FontWeight="SemiLight"
VerticalAlignment="Stretch"
VerticalContentAlignment="Center"
ToolTip.Tip="This will also be the folder name"
Text="{Binding InstallName, Mode=TwoWay}" />
<Label Margin="8,0"
Content="{Binding FullInstallPath}" Foreground="LightGray" />
<StackPanel Orientation="Horizontal"
Margin="8,8,8,8"
IsVisible="{Binding ShowDuplicateWarning}">
<avalonia:SymbolIcon
Foreground="{DynamicResource ThemeRedColor}"
Margin="0,0,8,0"
Symbol="Alert" />
<TextBlock
Foreground="{DynamicResource ThemeRedColor}"
TextAlignment="Left"
TextWrapping="Wrap">
<Run Text="{x:Static lang:Resources.Label_InstallationWithThisNameExists}" />
<LineBreak />
<Run Text="{x:Static lang:Resources.Label_PleaseChooseDifferentName}" />
</TextBlock>
</StackPanel>
<Expander Header="{x:Static lang:Resources.Label_AdvancedOptions}"
FontSize="16"
HorizontalAlignment="Stretch"
Margin="8">
<WrapPanel Margin="8,0">
<StackPanel Orientation="Vertical" Margin="0,4,24,0">
<Label Content="{x:Static lang:Resources.Label_SharedModelStrategyShort}" />
<controls1:FAComboBox ItemsSource="{Binding SelectedPackage.AvailableSharedFolderMethods}"
MinWidth="150"
MinHeight="38"
SelectedItem="{Binding SelectedSharedFolderMethod}">
<controls1:FAComboBox.ItemTemplate>
<DataTemplate DataType="{x:Type models:SharedFolderMethod}">
<TextBlock
Margin="8,4,0,4"
Text="{Binding }" />
</DataTemplate>
</controls1:FAComboBox.ItemTemplate>
</controls1:FAComboBox>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,4,24,0">
<Label Content="{x:Static lang:Resources.Label_PyTorchVersion}"
IsVisible="{Binding ShowTorchVersionOptions}"/>
<controls1:FAComboBox ItemsSource="{Binding SelectedPackage.AvailableTorchVersions}"
MinWidth="150"
MinHeight="38"
IsVisible="{Binding ShowTorchVersionOptions}"
SelectedItem="{Binding SelectedTorchVersion}">
<controls1:FAComboBox.ItemTemplate>
<DataTemplate DataType="{x:Type models:TorchVersion}">
<TextBlock
Margin="8,4,0,4"
Text="{Binding }" />
</DataTemplate>
</controls1:FAComboBox.ItemTemplate>
</controls1:FAComboBox>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,4,24,0">
<Label Content="{x:Static lang:Resources.Label_Commit}"
IsVisible="{Binding !IsReleaseMode}" />
<controls1:FAComboBox IsVisible="{Binding !IsReleaseMode}"
ItemsSource="{Binding AvailableCommits}"
MinWidth="150"
MinHeight="38"
SelectedItem="{Binding SelectedCommit}">
<controls1:FAComboBox.ItemTemplate>
<DataTemplate DataType="{x:Type database:GitCommit}">
<TextBlock
Margin="8,4,0,4"
Name="NameTextBlock"
Text="{Binding ShortSha}" />
</DataTemplate>
</controls1:FAComboBox.ItemTemplate>
</controls1:FAComboBox>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,4,24,0"
IsVisible="{Binding !!SelectedPackage.SharedOutputFolders}">
<Label Content="{x:Static lang:Resources.Label_UseSharedOutputFolder}"/>
<ToggleSwitch VerticalAlignment="Center"
VerticalContentAlignment="Center"
IsChecked="{Binding IsOutputSharingEnabled}"/>
</StackPanel>
</WrapPanel>
</Expander>
<Button Classes="success"
Margin="8,8,8,8"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
FontSize="16"
IsEnabled="{Binding CanInstall}"
Command="{Binding InstallCommand}"
Content="{x:Static lang:Resources.Action_Install}" />
</StackPanel>
</Grid>
</controls:UserControlBase>