diff --git a/Dashboard/Controls/LandingPage.xaml.cs b/Dashboard/Controls/LandingPage.xaml.cs index 3e35e23a..b0816dee 100644 --- a/Dashboard/Controls/LandingPage.xaml.cs +++ b/Dashboard/Controls/LandingPage.xaml.cs @@ -82,6 +82,9 @@ private void LoadServers() _serverHealthStatuses.Add(new ServerHealthStatus(server)); } + // Sort servers alphabetically by display name + _serverHealthStatuses.OrderBy(s => s.Server.DisplayName).ToList().ForEach(s => _serverHealthStatuses.Move(_serverHealthStatuses.IndexOf(s), _serverHealthStatuses.Count - 1)); + UpdateSubtitle(); UpdateEmptyState(); } diff --git a/Dashboard/MainWindow.xaml.cs b/Dashboard/MainWindow.xaml.cs index 0836a4ef..be8ab37b 100644 --- a/Dashboard/MainWindow.xaml.cs +++ b/Dashboard/MainWindow.xaml.cs @@ -24,6 +24,8 @@ using PerformanceMonitorDashboard.Controls; using PerformanceMonitorDashboard.Helpers; using PerformanceMonitorDashboard.Services; +using System.ComponentModel; +using System.Windows.Data; namespace PerformanceMonitorDashboard { @@ -348,6 +350,9 @@ private void LoadServerList() _serverListItems.Add(new ServerListItem(server, status)); } + // Add default sort for the list of servers by server display name. + _serverListItems.OrderBy(s => s.DisplayName).ToList().ForEach(s => _serverListItems.Move(_serverListItems.IndexOf(s), _serverListItems.Count - 1)); + // Also refresh the landing page if it exists if (_landingPage != null) {