From 78ff66fe79f117badf0405cd21d4754db39e8025 Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Thu, 12 Feb 2026 10:21:41 -0500 Subject: [PATCH] Lite overview: show Online/Offline status for servers (#2) Overview cards now display connection status with a colored dot (green/red), status label, and a semi-transparent offline overlay with red X for unreachable servers. Offline servers also get a red card border. Connection status is sourced from the existing ServerManager connection tracking. Closes #2 Co-Authored-By: Claude Opus 4.6 --- Lite/MainWindow.xaml | 75 ++++++++++++++-------- Lite/MainWindow.xaml.cs | 2 + Lite/Services/LocalDataService.Overview.cs | 13 +++- 3 files changed, 61 insertions(+), 29 deletions(-) diff --git a/Lite/MainWindow.xaml b/Lite/MainWindow.xaml index adea8549..aa6996b0 100644 --- a/Lite/MainWindow.xaml +++ b/Lite/MainWindow.xaml @@ -12,6 +12,7 @@ + @@ -190,37 +191,55 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Lite/MainWindow.xaml.cs b/Lite/MainWindow.xaml.cs index fb6589ef..fb231638 100644 --- a/Lite/MainWindow.xaml.cs +++ b/Lite/MainWindow.xaml.cs @@ -340,6 +340,8 @@ private async Task RefreshOverviewAsync() if (summary != null) { summary.ServerName = server.ServerName; + var connStatus = _serverManager.GetConnectionStatus(server.Id); + summary.IsOnline = connStatus.IsOnline; summaries.Add(summary); } } diff --git a/Lite/Services/LocalDataService.Overview.cs b/Lite/Services/LocalDataService.Overview.cs index 8258323a..2e45a864 100644 --- a/Lite/Services/LocalDataService.Overview.cs +++ b/Lite/Services/LocalDataService.Overview.cs @@ -125,6 +125,7 @@ public class ServerSummaryItem public string DisplayName { get; set; } = ""; public string ServerName { get; set; } = ""; public int ServerId { get; set; } + public bool? IsOnline { get; set; } public double? CpuPercent { get; set; } public double? MemoryMb { get; set; } public int BlockingCount { get; set; } @@ -137,11 +138,21 @@ public class ServerSummaryItem public string DeadlockDisplay => DeadlockCount > 0 ? DeadlockCount.ToString() : "0"; public string LastCollectionDisplay => LastCollectionTime.HasValue ? ServerTimeHelper.FormatServerTime(LastCollectionTime, "HH:mm:ss") : "Never"; + /* Connection status */ + public string StatusDisplay => IsOnline switch { true => "Online", false => "Offline", _ => "Unknown" }; + public SolidColorBrush StatusBrush => MakeBrush(IsOnline switch { true => "#4CAF50", false => "#EF4444", _ => "#888888" }); + public bool IsOffline => IsOnline == false; + /* Color coding */ public SolidColorBrush CpuBrush => MakeBrush(CpuPercent >= 80 ? "#F44336" : CpuPercent >= 50 ? "#FF9800" : "#4CAF50"); public SolidColorBrush BlockingBrush => MakeBrush(BlockingCount > 0 ? "#FF9800" : "#4CAF50"); public SolidColorBrush DeadlockBrush => MakeBrush(DeadlockCount > 0 ? "#F44336" : "#4CAF50"); - public SolidColorBrush CardBorderBrush => MakeBrush(DeadlockCount > 0 ? "#F44336" : BlockingCount > 0 ? "#FF9800" : CpuPercent >= 80 ? "#FF9800" : "#555555"); + public SolidColorBrush CardBorderBrush => MakeBrush( + IsOnline == false ? "#EF4444" : + DeadlockCount > 0 ? "#F44336" : + BlockingCount > 0 ? "#FF9800" : + CpuPercent >= 80 ? "#FF9800" : + "#555555"); private static SolidColorBrush MakeBrush(string hex) {