Browse Source

Merge branch 'inference-reference-controlnet' of https://github.com/ionite34/StabilityMatrix into inference-reference-controlnet

pull/629/head
Ionite 8 months ago
parent
commit
8c2ea813db
No known key found for this signature in database
  1. 1
      CHANGELOG.md
  2. 21
      StabilityMatrix.Avalonia/ViewModels/Dialogs/ConfirmPackageDeleteDialogViewModel.cs
  3. 16
      StabilityMatrix.Avalonia/ViewModels/PackageManager/PackageCardViewModel.cs
  4. 2
      StabilityMatrix.Avalonia/Views/ConsoleOutputPage.axaml
  5. 55
      StabilityMatrix.Avalonia/Views/Dialogs/ConfirmPackageDeleteDialog.axaml
  6. 13
      StabilityMatrix.Avalonia/Views/Dialogs/ConfirmPackageDeleteDialog.axaml.cs

1
CHANGELOG.md

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2
### Fixed
- Fixed Outputs page not remembering where the user last was in the TreeView in certain circumstances
- Fixed Inference extension upgrades not being added to missing extensions list for prompted install
- Fixed "The Open Web UI button has moved" teaching tip spam
## v2.10.0-dev.1
### Added

21
StabilityMatrix.Avalonia/ViewModels/Dialogs/ConfirmPackageDeleteDialogViewModel.cs

@ -0,0 +1,21 @@
using System;
using CommunityToolkit.Mvvm.ComponentModel;
using StabilityMatrix.Avalonia.ViewModels.Base;
using StabilityMatrix.Avalonia.Views.Dialogs;
using StabilityMatrix.Core.Attributes;
namespace StabilityMatrix.Avalonia.ViewModels.Dialogs;
[View(typeof(ConfirmPackageDeleteDialog))]
[ManagedService]
[Transient]
public partial class ConfirmPackageDeleteDialogViewModel : ContentDialogViewModelBase
{
public required string ExpectedPackageName { get; set; }
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(IsValid))]
private string packageName = string.Empty;
public bool IsValid => ExpectedPackageName.Equals(PackageName, StringComparison.Ordinal);
}

16
StabilityMatrix.Avalonia/ViewModels/PackageManager/PackageCardViewModel.cs

@ -321,13 +321,17 @@ public partial class PackageCardViewModel(
return;
}
var dialog = new ContentDialog
var dialogViewModel = vmFactory.Get<ConfirmPackageDeleteDialogViewModel>(vm =>
{
Title = Resources.Label_ConfirmDelete,
Content = Resources.Text_PackageUninstall_Details,
PrimaryButtonText = Resources.Action_OK,
CloseButtonText = Resources.Action_Cancel,
DefaultButton = ContentDialogButton.Primary
vm.ExpectedPackageName = Package?.DisplayName;
});
var dialog = new BetterContentDialog
{
Content = dialogViewModel,
IsPrimaryButtonEnabled = false,
IsSecondaryButtonEnabled = false,
IsFooterVisible = false,
};
var result = await dialog.ShowAsync();

2
StabilityMatrix.Avalonia/Views/ConsoleOutputPage.axaml

@ -88,6 +88,6 @@
Target="{Binding #OpenWebUiButton}"
Title="{x:Static lang:Resources.TeachingTip_WebUiButtonMoved}"
PreferredPlacement="Bottom"
IsOpen="True"/>
IsOpen="{Binding ShowWebUiTeachingTip}"/>
</Grid>
</controls:UserControlBase>

55
StabilityMatrix.Avalonia/Views/Dialogs/ConfirmPackageDeleteDialog.axaml

@ -0,0 +1,55 @@
<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:lang="clr-namespace:StabilityMatrix.Avalonia.Languages"
xmlns:dialogs="clr-namespace:StabilityMatrix.Avalonia.ViewModels.Dialogs"
xmlns:controls1="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:DataType="dialogs:ConfirmPackageDeleteDialogViewModel"
x:Class="StabilityMatrix.Avalonia.Views.Dialogs.ConfirmPackageDeleteDialog">
<Grid RowDefinitions="Auto, Auto, Auto, Auto, *"
Margin="8">
<TextBlock Text="{x:Static lang:Resources.Text_PackageUninstall_Details}"
FontWeight="Bold"
FontSize="20"
TextAlignment="Center"
TextWrapping="Wrap"/>
<TextBlock Grid.Row="1"
Margin="0,32,0,8"
TextAlignment="Center">
<Run Text="Please type"/>
<Run FontWeight="Bold" Text="{Binding ExpectedPackageName}"/>
<Run Text="to confirm the deletion of the package:"/>
</TextBlock>
<TextBox Grid.Row="2"
Text="{Binding PackageName, Mode=TwoWay}"
Margin="0,16,0,0"/>
<controls1:InfoBar Grid.Row="3"
Margin="0,16,0,0"
IsClosable="False"
IsOpen="True"
Title="{x:Static lang:Resources.Label_ActionCannotBeUndone}"
Severity="Warning"/>
<UniformGrid Grid.Row="4" HorizontalAlignment="Stretch"
VerticalAlignment="Bottom"
Margin="0,32,0,0">
<Button Content="{x:Static lang:Resources.Action_Delete}"
Classes="danger"
IsEnabled="{Binding IsValid}"
HorizontalAlignment="Stretch"
Margin="0,0,4,0"
Command="{Binding OnPrimaryButtonClick}"
FontSize="16"/>
<Button Content="{x:Static lang:Resources.Action_Cancel}"
Command="{Binding OnCloseButtonClick}"
Margin="4,0,0,0"
HorizontalAlignment="Stretch"
FontSize="16"/>
</UniformGrid>
</Grid>
</controls:UserControlBase>

13
StabilityMatrix.Avalonia/Views/Dialogs/ConfirmPackageDeleteDialog.axaml.cs

@ -0,0 +1,13 @@
using StabilityMatrix.Avalonia.Controls;
using StabilityMatrix.Core.Attributes;
namespace StabilityMatrix.Avalonia.Views.Dialogs;
[Transient]
public partial class ConfirmPackageDeleteDialog : UserControlBase
{
public ConfirmPackageDeleteDialog()
{
InitializeComponent();
}
}
Loading…
Cancel
Save