Enhance SwarmUI integration by adding swarm connection status to the API and updating client-side components to reflect this status. Improved localization strings for various SwarmUI states and refactored ApplicantsDialog and PersonCard components to utilize the new connection information, ensuring a more responsive user experience.
ci / server (push) Failing after 4m56s
ci / client (push) Failing after 15s

This commit is contained in:
Leonid Pershin
2026-08-20 04:21:35 +03:00
parent 36b46774a7
commit 5991dcd5c4
13 changed files with 246 additions and 33 deletions
+27
View File
@@ -28,6 +28,33 @@ internal sealed class SwarmUiClient
public bool IsConfigured => !string.IsNullOrWhiteSpace(_options.BaseUrl);
/// <summary>Opens a session to verify SwarmUI responds; does not generate an image.</summary>
public async Task<bool> ProbeAsync(TimeSpan timeout, CancellationToken cancellationToken)
{
if (!IsConfigured)
{
return false;
}
using var timeoutSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
timeoutSource.CancelAfter(timeout);
try
{
await RefreshSessionAsync(timeoutSource.Token);
return true;
}
catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested)
{
return false;
}
catch (Exception ex)
{
_logger.LogDebug(ex, "SwarmUI probe failed.");
return false;
}
}
public async Task<byte[]> GenerateAsync(
string prompt,
string negativePrompt,