Fix empty Sonic discovery: KnownContainers fallback and clearer domain status.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-24 08:19:51 +02:00
co-authored by Cursor
parent c2268f1908
commit 0e9eb27119
5 changed files with 235 additions and 47 deletions
+30 -12
View File
@@ -1829,23 +1829,41 @@ namespace ZA.CoreService.ESBCertificateManager
return;
}
// Grid mit entdeckten Containern befüllen
// Grid mit entdeckten + konfigurierten Containern befüllen
_loadedTargets = result.DiscoveredTargets;
BindTargetsToGrid(result.DiscoveredTargets);
int configured = result.DiscoveredTargets.Count(t => !string.IsNullOrWhiteSpace(t.TargetDirectory));
int discovered = result.RawContainerNames.Count;
int total = result.DiscoveredTargets.Count;
int remote = result.RawContainerNames.Count;
string domain = string.IsNullOrWhiteSpace(result.DomainName)
? selectedConnection
: result.DomainName;
lblSonicStatus.Text = discovered > 0
? $"{discovered} Container gefunden, {configured} konfiguriert"
: $"Verbindung ok keine Container in Domain '{selectedConnection}'";
lblSonicStatus.ForeColor = discovered > 0 ? GreenColor : GoldColor;
if (total == 0)
{
lblSonicStatus.Text = $"Verb. ok 0 Container in Domain '{domain}'";
lblSonicStatus.ForeColor = GoldColor;
SetStatus(
result.ErrorMessage
?? $"Sonic Domain '{domain}': keine Container. KnownContainers/SonicHome in appsettings prüfen.",
isError: true);
}
else if (remote == 0)
{
lblSonicStatus.Text = $"Verb. ok Domain '{domain}': 0 remote, {total} aus Config";
lblSonicStatus.ForeColor = GoldColor;
SetStatus(
$"Domain '{domain}': Remote leer {total} Ziel(e) aus appsettings/KnownContainers. "
+ (result.ErrorMessage ?? string.Empty),
isError: false);
}
else
{
lblSonicStatus.Text = $"Domain '{domain}': {remote} remote, {total} gesamt";
lblSonicStatus.ForeColor = GreenColor;
SetStatus($"Sonic Domain '{domain}': {total} Ziel(e) geladen ({remote} remote).", isError: false);
}
SetStatus(
$"Sonic {selectedConnection}: {discovered} Container geladen.",
isError: false);
// Nicht-konfigurierte Ziele visuell markieren
MarkUnconfiguredRows();
}
catch (OperationCanceledException)