Skip to content

Commit cb68d90

Browse files
committed
Merge branch 'refs/heads/dev' into proxy
# Conflicts: # StabilityMatrix.Avalonia/Languages/Resources.resx
2 parents 8032015 + 33705e0 commit cb68d90

File tree

102 files changed

+1942
-350
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+1942
-350
lines changed

.husky/task-runner.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
"group": "generate-openapi",
2020
"command": "dotnet",
2121
"args": ["refitter", "--settings-file", "./StabilityMatrix.Core/Api/LykosAuthApi/.refitter"]
22+
},
23+
{
24+
"name": "Run refitter for PromptGenApi",
25+
"group": "generate-promptgen-openapi",
26+
"command": "dotnet",
27+
"args": ["refitter", "--settings-file", "./StabilityMatrix.Core/Api/PromptGen/.refitter"]
2228
}
2329
]
2430
}

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html).
77

88
## v2.14.0-pre.2
9+
### Added
10+
- Added new package - [Stable Diffusion WebUI Forge - Classic](https://github.com/Haoming02/sd-webui-forge-classic)
11+
- Added Undo/Redo commands to text editor context menus
912
### Changed
1013
- Updated install for kohya_ss to support RTX 5000-series GPUs
1114
### Fixed

StabilityMatrix.Avalonia/App.axaml.cs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
using StabilityMatrix.Avalonia.Views;
5454
using StabilityMatrix.Core.Api;
5555
using StabilityMatrix.Core.Api.LykosAuthApi;
56+
using StabilityMatrix.Core.Api.PromptGenApi;
5657
using StabilityMatrix.Core.Attributes;
5758
using StabilityMatrix.Core.Converters.Json;
5859
using StabilityMatrix.Core.Database;
@@ -133,6 +134,14 @@ public sealed class App : Application
133134
#else
134135
public const string LykosAccountApiBaseUrl = "https://account.lykos.ai/";
135136
#endif
137+
#if DEBUG
138+
// ReSharper disable twice LocalizableElement
139+
// ReSharper disable once ConditionalAccessQualifierIsNonNullableAccordingToAPIContract
140+
public static string PromptGenApiBaseUrl =>
141+
Config?["PromptGenApiBaseUrl"] ?? "https://promptgen.lykos.ai/api";
142+
#else
143+
public const string PromptGenApiBaseUrl = "https://promptgen.lykos.ai/api";
144+
#endif
136145

137146
// ReSharper disable once MemberCanBePrivate.Global
138147
public IClassicDesktopStyleApplicationLifetime? DesktopLifetime =>
@@ -369,7 +378,7 @@ internal static void ConfigurePageViewModels(IServiceCollection services)
369378
new MainWindowViewModel(
370379
provider.GetRequiredService<ISettingsManager>(),
371380
provider.GetRequiredService<IDiscordRichPresenceService>(),
372-
provider.GetRequiredService<ServiceManager<ViewModelBase>>(),
381+
provider.GetRequiredService<IServiceManager<ViewModelBase>>(),
373382
provider.GetRequiredService<ITrackedDownloadService>(),
374383
provider.GetRequiredService<IModelIndexService>(),
375384
provider.GetRequiredService<Lazy<IModelDownloadLinkHandler>>(),
@@ -651,6 +660,21 @@ internal static IServiceCollection ConfigureServices()
651660
new TokenAuthHeaderHandler(serviceProvider.GetRequiredService<LykosAuthTokenProvider>())
652661
);
653662

663+
services
664+
.AddRefitClient<IPromptGenApi>(defaultRefitSettings)
665+
.ConfigureHttpClient(c =>
666+
{
667+
c.BaseAddress = new Uri(PromptGenApiBaseUrl);
668+
c.Timeout = TimeSpan.FromHours(1);
669+
c.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "");
670+
})
671+
.ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler { AllowAutoRedirect = false })
672+
.AddPolicyHandler(retryPolicy)
673+
.AddHttpMessageHandler(
674+
serviceProvider =>
675+
new TokenAuthHeaderHandler(serviceProvider.GetRequiredService<LykosAuthTokenProvider>())
676+
);
677+
654678
services
655679
.AddRefitClient<ILykosAnalyticsApi>(defaultRefitSettings)
656680
.ConfigureHttpClient(c =>

StabilityMatrix.Avalonia/Controls/BetterDownloadableComboBox.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ private static async Task PromptDownloadAsync(IDownloadableResource downloadable
5454
if (downloadable.DownloadableResource is not { } resource)
5555
return;
5656

57-
var vmFactory = App.Services.GetRequiredService<ServiceManager<ViewModelBase>>();
57+
var vmFactory = App.Services.GetRequiredService<IServiceManager<ViewModelBase>>();
5858
var confirmDialog = vmFactory.Get<DownloadResourceViewModel>();
5959
confirmDialog.Resource = resource;
6060
confirmDialog.FileName = resource.FileName;

StabilityMatrix.Avalonia/Controls/EditorCommands.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,10 @@ public static class EditorCommands
1313

1414
public static RelayCommand<TextEditor> PasteCommand { get; } =
1515
new(editor => editor?.Paste(), editor => editor?.CanPaste ?? false);
16+
17+
public static RelayCommand<TextEditor> UndoCommand { get; } =
18+
new(editor => editor?.Undo(), editor => editor?.CanUndo ?? false);
19+
20+
public static RelayCommand<TextEditor> RedoCommand { get; } =
21+
new(editor => editor?.Redo(), editor => editor?.CanRedo ?? false);
1622
}
Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,40 @@
1-
<ResourceDictionary xmlns="https://github.com/avaloniaui"
2-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3-
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
4-
xmlns:avaloniaEdit="https://github.com/avaloniaui/avaloniaedit"
5-
xmlns:controls="clr-namespace:StabilityMatrix.Avalonia.Controls">
6-
<!-- Context menu for editors -->
1+
<ResourceDictionary
2+
xmlns="https://github.com/avaloniaui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:avaloniaEdit="https://github.com/avaloniaui/avaloniaedit"
5+
xmlns:controls="clr-namespace:StabilityMatrix.Avalonia.Controls"
6+
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia">
7+
<!-- Context menu for editors -->
78
<ui:FAMenuFlyout x:Key="EditorContextFlyout">
89
<ui:MenuFlyoutItem
9-
Text="Paste"
10-
IconSource="Paste"
11-
HotKey="Ctrl+V"
1210
Command="{x:Static controls:EditorCommands.PasteCommand}"
13-
CommandParameter="{Binding $parent[avaloniaEdit:TextEditor]}"/>
11+
CommandParameter="{Binding $parent[avaloniaEdit:TextEditor]}"
12+
HotKey="Ctrl+V"
13+
IconSource="Paste"
14+
Text="Paste" />
1415
<ui:MenuFlyoutItem
15-
Text="Copy"
16-
IconSource="Copy"
17-
HotKey="Ctrl+C"
1816
Command="{x:Static controls:EditorCommands.CopyCommand}"
19-
CommandParameter="{Binding $parent[avaloniaEdit:TextEditor]}"/>
17+
CommandParameter="{Binding $parent[avaloniaEdit:TextEditor]}"
18+
HotKey="Ctrl+C"
19+
IconSource="Copy"
20+
Text="Copy" />
2021
<ui:MenuFlyoutItem
21-
Text="Cut"
22-
IconSource="Cut"
23-
HotKey="Ctrl+X"
2422
Command="{x:Static controls:EditorCommands.CutCommand}"
25-
CommandParameter="{Binding $parent[avaloniaEdit:TextEditor]}"/>
23+
CommandParameter="{Binding $parent[avaloniaEdit:TextEditor]}"
24+
HotKey="Ctrl+X"
25+
IconSource="Cut"
26+
Text="Cut" />
27+
<ui:MenuFlyoutItem
28+
Command="{x:Static controls:EditorCommands.UndoCommand}"
29+
CommandParameter="{Binding $parent[avaloniaEdit:TextEditor]}"
30+
HotKey="Ctrl+Z"
31+
IconSource="Undo"
32+
Text="Undo" />
33+
<ui:MenuFlyoutItem
34+
Command="{x:Static controls:EditorCommands.RedoCommand}"
35+
CommandParameter="{Binding $parent[avaloniaEdit:TextEditor]}"
36+
HotKey="Ctrl+Y"
37+
IconSource="Redo"
38+
Text="Redo" />
2639
</ui:FAMenuFlyout>
2740
</ResourceDictionary>

StabilityMatrix.Avalonia/Controls/FADownloadableComboBox.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private static async Task PromptDownloadAsync(IDownloadableResource downloadable
5555
if (downloadable.DownloadableResource is not { } resource)
5656
return;
5757

58-
var vmFactory = App.Services.GetRequiredService<ServiceManager<ViewModelBase>>();
58+
var vmFactory = App.Services.GetRequiredService<IServiceManager<ViewModelBase>>();
5959
var confirmDialog = vmFactory.Get<DownloadResourceViewModel>();
6060
confirmDialog.Resource = resource;
6161
confirmDialog.FileName = resource.FileName;

0 commit comments

Comments
 (0)