From f929aaebb7a3b7486b520c187067e65963fe78ab Mon Sep 17 00:00:00 2001 From: Jo Palac Date: Wed, 26 Aug 2026 13:48:42 +1000 Subject: [PATCH 1/6] SCMU add instance UI changes --- .../AddServiceControlInstanceCommand.cs | 32 +- .../UI/InstanceAdd/ServiceControlAddView.xaml | 74 +--- .../InstanceAdd/ServiceControlAddViewModel.cs | 4 +- .../UI/Shell/NewInstancePopup.xaml | 353 +++++++++++------- .../UI/Shell/NewInstancePopup.xaml.cs | 223 ++++++++++- .../UI/Shell/ShellViewModel.cs | 8 + 6 files changed, 485 insertions(+), 209 deletions(-) diff --git a/src/ServiceControl.Config/Commands/AddServiceControlInstanceCommand.cs b/src/ServiceControl.Config/Commands/AddServiceControlInstanceCommand.cs index c8ce21013e..a3176cce56 100644 --- a/src/ServiceControl.Config/Commands/AddServiceControlInstanceCommand.cs +++ b/src/ServiceControl.Config/Commands/AddServiceControlInstanceCommand.cs @@ -1,6 +1,8 @@ -namespace ServiceControl.Config.Commands +namespace ServiceControl.Config.Commands { using System; + using System.Linq; + using System.Threading; using System.Threading.Tasks; using Framework; using Framework.Commands; @@ -27,8 +29,34 @@ public override async Task ExecuteAsync(object obj) await windowManager.ShowInnerDialog(instanceViewModel); } + public async Task ExecuteWithOptions(bool installError, bool installAudit, bool installServicePulse, CancellationToken cancellationToken = default) + { + if (!await commandChecks.CanAddInstance(true, cancellationToken)) + { + return; + } + + var instanceViewModel = addInstance(); + instanceViewModel.InstallErrorInstance = installError; + instanceViewModel.InstallAuditInstance = installAudit; + + if (installError) + { + var spOption = installServicePulse + ? instanceViewModel.ServiceControl.EnableIntegratedServicePulseOptions.FirstOrDefault(o => o.Value) + : instanceViewModel.ServiceControl.EnableIntegratedServicePulseOptions.FirstOrDefault(o => !o.Value); + + if (spOption != null) + { + instanceViewModel.ServiceControl.EnableIntegratedServicePulse = spOption; + } + } + + await windowManager.ShowInnerDialog(instanceViewModel, cancellationToken: cancellationToken); + } + readonly Func addInstance; readonly IServiceControlWindowManager windowManager; readonly ScmuCommandChecks commandChecks; } -} \ No newline at end of file +} diff --git a/src/ServiceControl.Config/UI/InstanceAdd/ServiceControlAddView.xaml b/src/ServiceControl.Config/UI/InstanceAdd/ServiceControlAddView.xaml index 2e0edd5bfe..8b34111dc8 100644 --- a/src/ServiceControl.Config/UI/InstanceAdd/ServiceControlAddView.xaml +++ b/src/ServiceControl.Config/UI/InstanceAdd/ServiceControlAddView.xaml @@ -73,34 +73,14 @@ Converter={StaticResource boolToVis}}" /> - - - - - - - - - - - - - - + + + @@ -261,34 +241,17 @@ ItemsSource="{Binding ErrorEnableIntegratedServicePulseOptions}" SelectedValue="{Binding ErrorEnableIntegratedServicePulse}" /> - - + - - - - - - - - - - - - + + + @@ -458,8 +421,7 @@ ItemsSource="{Binding AuditEnableFullTextSearchOnBodiesOptions}" SelectedValue="{Binding AuditEnableFullTextSearchOnBodies}" /> - - + diff --git a/src/ServiceControl.Config/UI/InstanceAdd/ServiceControlAddViewModel.cs b/src/ServiceControl.Config/UI/InstanceAdd/ServiceControlAddViewModel.cs index 0b9621251b..02ddc46a89 100644 --- a/src/ServiceControl.Config/UI/InstanceAdd/ServiceControlAddViewModel.cs +++ b/src/ServiceControl.Config/UI/InstanceAdd/ServiceControlAddViewModel.cs @@ -396,9 +396,9 @@ public string AuditDatabasePath public TimeSpanUnits AuditRetentionUnits => ServiceControlAudit.AuditRetentionUnits; - public bool IsServiceControlExpanded { get; set; } + public bool IsServiceControlExpanded { get; set; } = true; - public bool IsServiceControlAuditExpanded { get; set; } + public bool IsServiceControlAuditExpanded { get; set; } = true; public double AuditRetention { diff --git a/src/ServiceControl.Config/UI/Shell/NewInstancePopup.xaml b/src/ServiceControl.Config/UI/Shell/NewInstancePopup.xaml index e33628785b..303e0b47a8 100644 --- a/src/ServiceControl.Config/UI/Shell/NewInstancePopup.xaml +++ b/src/ServiceControl.Config/UI/Shell/NewInstancePopup.xaml @@ -1,161 +1,226 @@ - - - - - - - - - - - - - + d:DesignHeight="500" d:DesignWidth="600"> + + + + + + + + + - - - - - - - - - - - - - - Add ServiceControl and Audit Instances... - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - Add monitoring instance... - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - Learn more about monitoring - + FontWeight="SemiBold" + Foreground="{StaticResource Gray70Brush}" + Margin="0,0,0,5" + Text="This will install:" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +