Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions Dashboard/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,31 @@
Height="32"
Margin="0,0,0,8"/>
<Button x:Name="AlertsHistoryButton"
Content="Alerts"
Click="AlertsHistory_Click"
Style="{StaticResource AccentButton}"
Height="32"
Margin="0,0,0,8"/>
Margin="0,0,0,8">
<Grid>
<TextBlock Text="Alerts" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<Border x:Name="AlertBadge"
Background="#FF4444"
CornerRadius="8"
MinWidth="16" Height="16"
Padding="4,0"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="0,-4,-8,0"
Visibility="Collapsed">
<TextBlock x:Name="AlertBadgeText"
Text="0"
FontSize="10"
FontWeight="Bold"
Foreground="White"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</Grid>
</Button>
<Separator Margin="0,0,0,8"/>
<Button x:Name="RefreshAllButton"
Content="&#x21BB; Refresh All Status"
Expand Down
19 changes: 19 additions & 0 deletions Dashboard/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ private async void MainWindow_Loaded(object sender, RoutedEventArgs e)
LoadSidebarState();
ConfigureConnectionStatusTimer();
ConfigureAlertCheckTimer();
UpdateAlertBadge();
StartMcpServerIfEnabled();

_displayRefreshTimer.Start();
Expand Down Expand Up @@ -970,6 +971,24 @@ private async void AlertCheckTimer_Tick(object? sender, EventArgs e)

/* Auto-refresh alert history if the tab is open */
_alertsHistoryContent?.RefreshAlerts();

UpdateAlertBadge();
}

private void UpdateAlertBadge()
{
var alerts = _emailAlertService.GetAlertHistory(hoursBack: 24, limit: 100);
var count = alerts.Count;

if (count > 0)
{
AlertBadgeText.Text = count > 99 ? "99+" : count.ToString();
AlertBadge.Visibility = Visibility.Visible;
}
else
{
AlertBadge.Visibility = Visibility.Collapsed;
}
}

/// <summary>
Expand Down
Loading