Keep original UI; drop unused deploy/XApi/WinRM/TLS/SQL paths.
Form1 design unchanged; only MfApi restart and certificate recognition remain active. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1232,15 +1232,17 @@ namespace ZA.CoreService.ESBCertificateManager
|
||||
btnValidate.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||
btnValidate.Click += async (_, _) => await RunValidationAsync();
|
||||
|
||||
btnRestartOnly = CreateSecondaryButton("ESB neu starten");
|
||||
btnRestartOnly.Size = new Size(150, 42);
|
||||
// Primäraktion: Neustart (Deploy vorerst deaktiviert – Design/Layout bleibt)
|
||||
btnRestartOnly = CreatePrimaryButton("ESB neu starten");
|
||||
btnRestartOnly.Size = new Size(170, 42);
|
||||
btnRestartOnly.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||
btnRestartOnly.Click += async (_, _) => await RunRestartOnlyAsync();
|
||||
|
||||
btnDeploy = CreatePrimaryButton("Deployment starten");
|
||||
btnDeploy.Size = new Size(170, 42);
|
||||
btnDeploy.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||
btnDeploy.Click += async (_, _) => await RunDeploymentAsync();
|
||||
btnDeploy.Visible = false;
|
||||
btnDeploy.Enabled = false;
|
||||
|
||||
panel.Controls.Add(btnCancelRun);
|
||||
panel.Controls.Add(btnValidate);
|
||||
@@ -1249,8 +1251,7 @@ namespace ZA.CoreService.ESBCertificateManager
|
||||
|
||||
panel.Resize += (_, _) =>
|
||||
{
|
||||
btnDeploy.Left = panel.Width - btnDeploy.Width;
|
||||
btnRestartOnly.Left = btnDeploy.Left - btnRestartOnly.Width - 12;
|
||||
btnRestartOnly.Left = panel.Width - btnRestartOnly.Width;
|
||||
btnValidate.Left = btnRestartOnly.Left - btnValidate.Width - 12;
|
||||
btnCancelRun.Left = btnValidate.Left - btnCancelRun.Width - 12;
|
||||
};
|
||||
@@ -1383,8 +1384,10 @@ namespace ZA.CoreService.ESBCertificateManager
|
||||
}
|
||||
|
||||
btnCancelRun.Enabled = _isOperationRunning;
|
||||
btnValidate.Enabled = idle && hasCertificate && hasTargets;
|
||||
btnDeploy.Enabled = idle && hasCertificate && hasSelection;
|
||||
// Prüfung nur für Neustart-Voraussetzungen (Zertifikat optional)
|
||||
btnValidate.Enabled = idle && hasTargets;
|
||||
btnDeploy.Enabled = false;
|
||||
btnDeploy.Visible = false;
|
||||
if (btnRestartOnly is not null)
|
||||
{
|
||||
btnRestartOnly.Enabled = idle && hasSelection;
|
||||
@@ -1437,10 +1440,7 @@ namespace ZA.CoreService.ESBCertificateManager
|
||||
}
|
||||
|
||||
List<DeploymentTarget> selected = GetSelectedTargets();
|
||||
PreflightValidationResult result = _orchestrator.ValidatePreflight(
|
||||
txtCertificatePath.Text,
|
||||
_loadedCertificateInfo,
|
||||
selected);
|
||||
PreflightValidationResult result = _orchestrator.ValidateRestartOnly(selected);
|
||||
|
||||
HashSet<int> failedTargetIds = result.Issues
|
||||
.Where(i => i.TargetId is not null)
|
||||
@@ -1581,81 +1581,10 @@ namespace ZA.CoreService.ESBCertificateManager
|
||||
}
|
||||
}
|
||||
|
||||
private async Task RunDeploymentAsync()
|
||||
private Task RunDeploymentAsync()
|
||||
{
|
||||
if (_isOperationRunning || _loadedCertificateInfo is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
List<DeploymentTarget> selected = GetSelectedTargets();
|
||||
PreflightValidationResult preflight = _orchestrator.ValidatePreflight(
|
||||
txtCertificatePath.Text,
|
||||
_loadedCertificateInfo,
|
||||
selected);
|
||||
|
||||
if (!preflight.IsValid)
|
||||
{
|
||||
ShowPreflightIssues(
|
||||
preflight,
|
||||
"Deployment blockiert – Vorabprüfung fehlgeschlagen.",
|
||||
"Deployment");
|
||||
return;
|
||||
}
|
||||
|
||||
_runCts?.Dispose();
|
||||
_runCts = new CancellationTokenSource();
|
||||
SetOperationRunning(true);
|
||||
UpdateToNextStep(3);
|
||||
SetStatus($"Deployment läuft für {selected.Count} Ziel(e)…", isError: false);
|
||||
|
||||
Progress<TargetProgressUpdate> progress = new(update =>
|
||||
{
|
||||
SetTargetRowStatus(update.TargetId, update.StatusText);
|
||||
SetStatus(update.StatusText, isError: update.SuccessHint == false);
|
||||
});
|
||||
|
||||
try
|
||||
{
|
||||
DeploymentRunResult runResult = await _orchestrator.RunAsync(
|
||||
txtCertificatePath.Text,
|
||||
_loadedCertificateInfo,
|
||||
selected,
|
||||
progress,
|
||||
_runCts.Token);
|
||||
|
||||
foreach (TargetStepResult targetResult in runResult.TargetResults)
|
||||
{
|
||||
SetTargetRowStatus(targetResult.TargetId, targetResult.StatusText);
|
||||
}
|
||||
|
||||
UpdateToNextStep(4);
|
||||
SetStatus(
|
||||
runResult.OverallSuccess
|
||||
? $"Deployment erfolgreich ({runResult.TargetResults.Count} Ziel(e))."
|
||||
: "Deployment mit Fehlern beendet. Details in der Status-Spalte / Log.",
|
||||
isError: !runResult.OverallSuccess);
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
SetStatus("Deployment abgebrochen.", isError: true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
SetStatus($"Deployment fehlgeschlagen: {ex.Message}", isError: true);
|
||||
MessageBox.Show(
|
||||
this,
|
||||
ex.Message,
|
||||
"Deployment",
|
||||
MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
SetOperationRunning(false);
|
||||
_runCts?.Dispose();
|
||||
_runCts = null;
|
||||
}
|
||||
// Deploy/Kopieren absichtlich deaktiviert – UI-Design bleibt.
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private Panel CreateCard()
|
||||
|
||||
Reference in New Issue
Block a user