From 2bf0dcda1e4e9d1103979162636dcee96d23a331 Mon Sep 17 00:00:00 2001 From: Jeremy Tellier - ROG Date: Thu, 22 Jul 2021 19:12:21 +0100 Subject: [PATCH] Show Blurb until we can use ShowToast and make a real windows notification. Service Timeout in details page of service --- DesktopEdge/MainWindow.xaml.cs | 3 +++ DesktopEdge/Views/Screens/IdentityDetails.xaml | 2 ++ DesktopEdge/Views/Screens/IdentityDetails.xaml.cs | 11 +++++++++++ 3 files changed, 16 insertions(+) diff --git a/DesktopEdge/MainWindow.xaml.cs b/DesktopEdge/MainWindow.xaml.cs index 370a615a..f5b379da 100644 --- a/DesktopEdge/MainWindow.xaml.cs +++ b/DesktopEdge/MainWindow.xaml.cs @@ -576,6 +576,8 @@ namespace ZitiDesktopEdge { continue; } found.TimeoutMessage = notification.Message; + ShowBlurbAsync(found.TimeoutMessage, ""); // Replace with ShowToast(found.TimeoutMessage) when it gets merged + // Send Notification if (notification.MfaMaximumTimeout == 0) { found.MFAInfo.IsAuthenticated = false; // display mfa token icon @@ -588,6 +590,7 @@ namespace ZitiDesktopEdge { found.IsTimingOut = true; } } + // we may need to display mfa icon, based on the timer in UI, remove found.MFAInfo.IsAuthenticated setting in this function. // the below function can show mfa icon even after user authenticates successfully, in race conditions if (displayMFARequired) { diff --git a/DesktopEdge/Views/Screens/IdentityDetails.xaml b/DesktopEdge/Views/Screens/IdentityDetails.xaml index b200cd09..2fc31905 100644 --- a/DesktopEdge/Views/Screens/IdentityDetails.xaml +++ b/DesktopEdge/Views/Screens/IdentityDetails.xaml @@ -132,6 +132,8 @@ + + diff --git a/DesktopEdge/Views/Screens/IdentityDetails.xaml.cs b/DesktopEdge/Views/Screens/IdentityDetails.xaml.cs index f7672fcd..b5d31b23 100644 --- a/DesktopEdge/Views/Screens/IdentityDetails.xaml.cs +++ b/DesktopEdge/Views/Screens/IdentityDetails.xaml.cs @@ -218,6 +218,17 @@ namespace ZitiDesktopEdge { DetailPorts.Text = info.PortString; DetailUrl.Text = info.ToString(); + if (info.Timeout>-1) { + double timeSince = (DateTime.Now - info.TimeUpdated).TotalMinutes; + if (timeSince>0) { + TimeoutDetails.Text = timeSince+ " minutes"; + } else { + TimeoutDetails.Text = "Timed out"; + } + } else { + TimeoutDetails.Text = "Never"; + } + DetailsArea.Visibility = Visibility.Visible; DetailsArea.Opacity = 0; DetailsArea.Margin = new Thickness(0, 0, 0, 0);