TeamsNetphoneLink/TeamsNetphoneLinkWPF/WPF/DashboardWindow.xaml
2025-03-25 22:43:13 +01:00

263 lines
14 KiB
XML

<Window x:Class="TeamsNetphoneLink.WPF.DashboardWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:TeamsNetphoneLink.WPF.MVVM"
Title="TeamsNetphoneLink Dashboard" Height="554" Width="800"
Background="#FF1E1E1E" FontFamily="Segoe UI" ResizeMode="CanMinimize"
WindowStartupLocation="CenterScreen">
<Window.DataContext>
<local:DashboardViewModel />
</Window.DataContext>
<Window.Resources>
<!-- Button Style -->
<Style TargetType="Button">
<Setter Property="Background" Value="#FF0078D4"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="Padding" Value="10,5"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="4"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#0063B1"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- Status Border Style -->
<Style TargetType="Border" x:Key="StatusBorder">
<Setter Property="CornerRadius" Value="12"/>
<Setter Property="Padding" Value="10,5"/>
<Setter Property="Background" Value="#FF252526"/>
<Setter Property="MinWidth" Value="100"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
</Style>
<!-- Status Text Style -->
<Style TargetType="TextBlock" x:Key="StatusText">
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<!-- ListView Styling -->
<Style TargetType="ListView">
<Setter Property="Background" Value="#FF252526"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderBrush" Value="#FF3E3E40"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
</Style>
<!-- GridViewColumnHeader Style -->
<Style TargetType="GridViewColumnHeader">
<Setter Property="Background" Value="#FF252526"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderBrush" Value="#FF3E3E40"/>
<Setter Property="Padding" Value="5"/>
<Setter Property="Height" Value="32"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<!-- Header -->
<RowDefinition Height="Auto"/>
<!-- Status Panels -->
<RowDefinition Height="*"/>
<!-- Log Section -->
<RowDefinition Height="Auto"/>
<!-- Footer -->
</Grid.RowDefinitions>
<!-- Header -->
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,15">
<TextBlock FontSize="24" FontWeight="Bold" Text="{Binding AppTitle2}" Foreground="White"/>
<Border Visibility="{Binding VersionVisibility}" Background="{Binding VersionBackground}" CornerRadius="12" Padding="12,4" Margin="15,0">
<TextBlock Text="{Binding VersionText}" Foreground="White" FontSize="16"/>
</Border>
</StackPanel>
<!-- Status Indicators -->
<Grid Grid.Row="1" Margin="15,20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Left Status Column -->
<StackPanel Grid.Column="0">
<!-- Teams Local API Status -->
<StackPanel Orientation="Horizontal" Margin="0,8">
<TextBlock Text="Teams Local API Status" Width="180" FontWeight="Bold" Foreground="White"/>
<Border Style="{StaticResource StatusBorder}"
Background="{Binding TeamsLocalAPIStatusBackground}"
MouseDown="TeamsLocalAPIBorder_MouseDown">
<TextBlock Style="{StaticResource StatusText}" Text="{Binding TeamsLocalAPIStatusText}"/>
</Border>
</StackPanel>
<!-- Teams Graph API Status -->
<StackPanel Orientation="Horizontal" Margin="0,8">
<TextBlock Text="Teams Graph API Status" Width="180" FontWeight="Bold" Foreground="White"/>
<Border Style="{StaticResource StatusBorder}"
Background="{Binding TeamsGraphAPIStatusBackground}"
MouseDown="TeamsGraphAPIBorder_MouseDown">
<TextBlock Style="{StaticResource StatusText}" Text="{Binding TeamsGraphAPIStatusText}"/>
</Border>
</StackPanel>
<!-- NetPhone CLMGR Status -->
<StackPanel Orientation="Horizontal" Margin="0,8">
<TextBlock Text="NetPhone CLMGR Status" Width="180" FontWeight="Bold" Foreground="White"/>
<Border Style="{StaticResource StatusBorder}"
Background="{Binding NetphoneCLMGRStatusBackground}">
<TextBlock Style="{StaticResource StatusText}" Text="{Binding NetphoneCLMGRStatusText}"/>
</Border>
</StackPanel>
</StackPanel>
<!-- Right Status Column -->
<StackPanel Grid.Column="1">
<!-- Teams Meeting Status -->
<StackPanel Orientation="Horizontal" Margin="0,8">
<TextBlock Text="Teams Meeting" Width="180" FontWeight="Bold" Foreground="White"/>
<Border Style="{StaticResource StatusBorder}"
Background="{Binding TeamsMeetingStatusBackground}">
<TextBlock Style="{StaticResource StatusText}" Text="{Binding TeamsMeetingStatusText}"/>
</Border>
</StackPanel>
<!-- NetPhone Call Status -->
<StackPanel Orientation="Horizontal" Margin="0,8">
<TextBlock Text="NetPhone Call" Width="180" FontWeight="Bold" Foreground="White"/>
<Border Style="{StaticResource StatusBorder}"
Background="{Binding NetphoneCallStatusBackground}">
<TextBlock Style="{StaticResource StatusText}" Text="{Binding NetphoneCallStatusText}"/>
</Border>
</StackPanel>
</StackPanel>
</Grid>
<!-- Log Section -->
<Border Grid.Row="2" Margin="15,0,15,10" Background="#FF252526" CornerRadius="8">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Text="Activity Log"
FontSize="18"
FontWeight="Bold"
Foreground="White"
Margin="15,10"/>
<ListView x:Name="Log" Grid.Row="1"
ItemsSource="{Binding LogEntries}"
Margin="10,0,10,10"
VirtualizingPanel.IsVirtualizing="True"
IsHitTestVisible="False">
<ListView.View>
<GridView>
<GridViewColumn Width="80" Header="Time">
<GridViewColumn.DisplayMemberBinding>
<Binding Path="Time" StringFormat="{}{0:HH:mm:ss}"/>
</GridViewColumn.DisplayMemberBinding>
</GridViewColumn>
<GridViewColumn Width="60" Header="Type">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Type}" Foreground="White">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="#FF0078D4"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Type}" Value="Warn">
<Setter Property="Foreground" Value="Orange"/>
</DataTrigger>
<DataTrigger Binding="{Binding Type}" Value="Error">
<Setter Property="Foreground" Value="Red"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Width="120" Header="Subsystem">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Subsystem}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="White"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Subsystem}" Value="Netphone">
<Setter Property="Foreground" Value="#E20074"/>
</DataTrigger>
<DataTrigger Binding="{Binding Subsystem}" Value="TeamsGraphAPI">
<Setter Property="Foreground" Value="#4E5FBF"/>
</DataTrigger>
<DataTrigger Binding="{Binding Subsystem}" Value="TeamsLocalAPI">
<Setter Property="Foreground" Value="#4E5FBF"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Width="Auto" Header="Message"
DisplayMemberBinding="{Binding Message}"/>
</GridView>
</ListView.View>
</ListView>
</Grid>
</Border>
<!-- Footer -->
<StackPanel Grid.Row="3" Orientation="Horizontal" Margin="15,0,0,8">
<Button Click="SettingsButton_Click"
Padding="8"
FontSize="18"
VerticalAlignment="Center"
ToolTip="Settings">
<Button.Content>
<Path Data="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.68 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z"
Fill="White" Stretch="Uniform"/>
</Button.Content>
</Button>
<TextBlock Text="Entwickelt von Jan Krampitz"
VerticalAlignment="Center"
Foreground="White"
FontSize="10"
Margin="15,0"/>
</StackPanel>
</Grid>
</Window>