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
172 changes: 77 additions & 95 deletions Dashboard/AddServerDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,15 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Add SQL Server"
Height="550" Width="500"
SizeToContent="Height" Width="450" MaxHeight="700"
WindowStartupLocation="CenterOwner"
ResizeMode="NoResize"
Background="{DynamicResource BackgroundBrush}"
Foreground="{DynamicResource ForegroundBrush}">
<Window.Resources>
<Style TargetType="TextBox">
<Setter Property="Background" Value="{DynamicResource BackgroundLightBrush}"/>
<Setter Property="Foreground" Value="{DynamicResource ForegroundBrush}"/>
<Setter Property="CaretBrush" Value="{DynamicResource ForegroundBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
</Style>
<Style TargetType="PasswordBox">
<Setter Property="Background" Value="{DynamicResource BackgroundLightBrush}"/>
<Setter Property="Foreground" Value="{DynamicResource ForegroundBrush}"/>
<Setter Property="CaretBrush" Value="{DynamicResource ForegroundBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
</Style>
</Window.Resources>
<Grid Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
Expand All @@ -34,97 +20,93 @@
Foreground="{DynamicResource ForegroundBrush}"/>

<!-- Form Fields -->
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<StackPanel>
<!-- Display Name -->
<TextBlock Text="Display Name:" FontWeight="Bold" Margin="0,0,0,5"
Foreground="{DynamicResource ForegroundBrush}"/>
<TextBox x:Name="DisplayNameTextBox" Height="25" Margin="0,0,0,15"
ToolTip="Friendly name to display in the server list"/>
<StackPanel Grid.Row="1">
<!-- Server Name/Address -->
<TextBlock Text="Server Name/Address:" FontWeight="Bold" Margin="0,0,0,4"
Foreground="{DynamicResource ForegroundBrush}"/>
<TextBox x:Name="ServerNameTextBox" Margin="0,0,0,12"
ToolTip="e.g., localhost, server.domain.com, 192.168.1.100, server\instance"/>

<!-- Server Name/Address -->
<TextBlock Text="Server Name/Address:" FontWeight="Bold" Margin="0,0,0,5"
Foreground="{DynamicResource ForegroundBrush}"/>
<TextBox x:Name="ServerNameTextBox" Height="25" Margin="0,0,0,15"
ToolTip="e.g., localhost, server.domain.com, 192.168.1.100, server\instance"/>
<!-- Display Name -->
<TextBlock Text="Display Name (optional):" FontWeight="Bold" Margin="0,0,0,4"
Foreground="{DynamicResource ForegroundBrush}"/>
<TextBox x:Name="DisplayNameTextBox" Margin="0,0,0,12"
ToolTip="Friendly name to display in the server list"/>

<!-- Authentication Type -->
<TextBlock Text="Authentication:" FontWeight="Bold" Margin="0,0,0,4"
Foreground="{DynamicResource ForegroundBrush}"/>
<StackPanel Margin="0,0,0,12">
<RadioButton x:Name="WindowsAuthRadio" Content="Windows Authentication"
GroupName="Auth" IsChecked="True"
Foreground="{DynamicResource ForegroundBrush}"
Checked="AuthType_Changed" Margin="0,0,0,4"/>
<RadioButton x:Name="SqlAuthRadio" Content="SQL Server Authentication"
GroupName="Auth"
Foreground="{DynamicResource ForegroundBrush}"
Checked="AuthType_Changed" Margin="0,0,0,4"/>
<RadioButton x:Name="EntraMfaAuthRadio" Content="Microsoft Entra MFA"
GroupName="Auth"
Foreground="{DynamicResource ForegroundBrush}"
Checked="AuthType_Changed"
ToolTip="Interactive authentication with MFA for Azure SQL Database."/>
</StackPanel>

<!-- Authentication Type -->
<TextBlock Text="Authentication:" FontWeight="Bold" Margin="0,0,0,5"
<!-- SQL Authentication Fields -->
<StackPanel x:Name="SqlAuthPanel" Visibility="Collapsed" Margin="0,0,0,12">
<TextBlock Text="Username:" Margin="0,0,0,4"
Foreground="{DynamicResource ForegroundBrush}"/>
<StackPanel Margin="0,0,0,15">
<RadioButton x:Name="WindowsAuthRadio" Content="Windows Authentication"
GroupName="Auth" IsChecked="True"
Foreground="{DynamicResource ForegroundBrush}"
Checked="AuthType_Changed" Margin="0,0,0,4"/>
<RadioButton x:Name="SqlAuthRadio" Content="SQL Server Authentication"
GroupName="Auth"
Foreground="{DynamicResource ForegroundBrush}"
Checked="AuthType_Changed" Margin="0,0,0,4"/>
<RadioButton x:Name="EntraMfaAuthRadio" Content="Microsoft Entra MFA"
GroupName="Auth"
Foreground="{DynamicResource ForegroundBrush}"
Checked="AuthType_Changed"
ToolTip="Interactive authentication with MFA for Azure SQL Database."/>
</StackPanel>
<TextBox x:Name="UsernameTextBox" Margin="0,0,0,8"/>

<!-- SQL Authentication Fields -->
<StackPanel x:Name="SqlAuthPanel" Visibility="Collapsed" Margin="0,0,0,15">
<TextBlock Text="Username:" FontWeight="Bold" Margin="0,0,0,5"
Foreground="{DynamicResource ForegroundBrush}"/>
<TextBox x:Name="UsernameTextBox" Height="25" Margin="0,0,0,15"/>
<TextBlock Text="Password:" Margin="0,0,0,4"
Foreground="{DynamicResource ForegroundBrush}"/>
<PasswordBox x:Name="PasswordBox"/>
</StackPanel>

<TextBlock Text="Password:" FontWeight="Bold" Margin="0,0,0,5"
Foreground="{DynamicResource ForegroundBrush}"/>
<PasswordBox x:Name="PasswordBox" Height="25" Margin="0,0,0,0"/>
</StackPanel>
<!-- Microsoft Entra MFA Fields -->
<StackPanel x:Name="EntraMfaPanel" Visibility="Collapsed" Margin="0,0,0,12">
<TextBlock Text="Username (optional):" Margin="0,0,0,4"
Foreground="{DynamicResource ForegroundBrush}"/>
<TextBox x:Name="EntraMfaUsernameBox"
ToolTip="Optional: Pre-populate the authentication dialog with this email address"/>
</StackPanel>

<!-- Microsoft Entra MFA Fields -->
<StackPanel x:Name="EntraMfaPanel" Visibility="Collapsed" Margin="0,0,0,15">
<TextBlock Text="Username (optional):" FontWeight="Bold" Margin="0,0,0,5"
<!-- Connection Options -->
<TextBlock Text="Connection Options:" FontWeight="Bold" Margin="0,0,0,4"
Foreground="{DynamicResource ForegroundBrush}"/>
<StackPanel Margin="0,0,0,12">
<!-- Encryption Mode -->
<StackPanel Orientation="Horizontal" Margin="0,0,0,6">
<TextBlock Text="Encryption:" Width="80" VerticalAlignment="Center"
Foreground="{DynamicResource ForegroundBrush}"/>
<TextBox x:Name="EntraMfaUsernameBox" Height="25" Margin="0,0,0,0"
ToolTip="Optional: Pre-populate the authentication dialog with this email address"/>
<ComboBox x:Name="EncryptModeComboBox" Width="150"
SelectedIndex="1"
ToolTip="Optional: Encrypt if server supports it&#x0a;Mandatory: Always encrypt (fails if not supported)&#x0a;Strict: Full validation required">
<ComboBoxItem Content="Optional"/>
<ComboBoxItem Content="Mandatory"/>
<ComboBoxItem Content="Strict"/>
</ComboBox>
</StackPanel>

<!-- Description -->
<TextBlock Text="Description (optional):" FontWeight="Bold" Margin="0,0,0,5"
Foreground="{DynamicResource ForegroundBrush}"/>
<TextBox x:Name="DescriptionTextBox" Height="60" TextWrapping="Wrap"
AcceptsReturn="True" VerticalScrollBarVisibility="Auto" Margin="0,0,0,15"/>
<!-- Trust Server Certificate -->
<CheckBox x:Name="TrustServerCertificateCheckBox"
Content="Trust server certificate (skip certificate validation)"
IsChecked="False"
Foreground="{DynamicResource ForegroundBrush}"
ToolTip="When checked, accepts any server certificate without validation.&#x0a;Uncheck for stricter security (requires valid certificate)."
Margin="0,0,0,6"/>

<!-- Is Favorite -->
<CheckBox x:Name="IsFavoriteCheckBox" Content="Mark as favorite (appears at top of list)" Margin="0,0,0,15"
Foreground="{DynamicResource ForegroundBrush}"/>
<CheckBox x:Name="IsFavoriteCheckBox" Content="Mark as favorite (appears at top of list)"
Foreground="{DynamicResource ForegroundBrush}" Margin="0,0,0,6"/>

<!-- Connection Security Settings -->
<TextBlock Text="Connection Security:" FontWeight="Bold" Margin="0,0,0,5"
<!-- Description -->
<TextBlock Text="Description (optional):" Margin="0,4,0,4"
Foreground="{DynamicResource ForegroundBrush}"/>
<Border BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="10" Margin="0,0,0,15"
Background="{DynamicResource BackgroundLightBrush}">
<StackPanel>
<!-- Encryption Mode -->
<StackPanel Orientation="Horizontal" Margin="0,0,0,10">
<TextBlock Text="Encryption:" Width="140" VerticalAlignment="Center"
Foreground="{DynamicResource ForegroundBrush}"/>
<ComboBox x:Name="EncryptModeComboBox" Width="150"
SelectedIndex="1"
ToolTip="Optional: Encrypt if server supports it&#x0a;Mandatory: Always encrypt (fails if not supported)&#x0a;Strict: Full validation required">
<ComboBoxItem Content="Optional"/>
<ComboBoxItem Content="Mandatory"/>
<ComboBoxItem Content="Strict"/>
</ComboBox>
</StackPanel>

<!-- Trust Server Certificate -->
<CheckBox x:Name="TrustServerCertificateCheckBox"
Content="Trust Server Certificate (skip certificate validation)"
IsChecked="False"
Foreground="{DynamicResource ForegroundBrush}"
ToolTip="When checked, accepts any server certificate without validation.&#x0a;Uncheck for stricter security (requires valid certificate)."/>
</StackPanel>
</Border>
<TextBox x:Name="DescriptionTextBox" Height="60" TextWrapping="Wrap"
AcceptsReturn="True" VerticalScrollBarVisibility="Auto"/>
</StackPanel>
</ScrollViewer>
</StackPanel>

<!-- Status -->
<TextBlock x:Name="StatusText" Grid.Row="2"
Expand All @@ -133,8 +115,8 @@

<!-- Buttons -->
<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,15,0,0">
<Button x:Name="TestConnectionButton" Content="Test Connection" Width="120" Height="30" Margin="0,0,10,0" Click="TestConnection_Click"/>
<Button x:Name="SaveButton" Content="Save" Width="80" Height="30" Margin="0,0,10,0" Click="Save_Click" IsDefault="True"/>
<Button x:Name="TestConnectionButton" Content="Test Connection" Margin="0,0,8,0" Click="TestConnection_Click"/>
<Button x:Name="SaveButton" Content="Save" Width="80" Height="30" Margin="0,0,10,0" Click="Save_Click" IsDefault="True" Style="{StaticResource AccentButton}"/>
<Button Content="Cancel" Width="80" Height="30" Click="Cancel_Click" IsCancel="True"/>
</StackPanel>
</Grid>
Expand Down
35 changes: 35 additions & 0 deletions Dashboard/Themes/CoolBreezeTheme.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,41 @@
</Setter>
</Style>

<!-- ============================================ -->
<!-- PasswordBox Style -->
<!-- ============================================ -->
<Style TargetType="PasswordBox">
<Setter Property="Background" Value="{StaticResource BackgroundDarkBrush}"/>
<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
<Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="6,4"/>
<Setter Property="CaretBrush" Value="{StaticResource ForegroundBrush}"/>
<Setter Property="SelectionBrush" Value="{StaticResource AccentBrush}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="PasswordBox">
<Border x:Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="3">
<ScrollViewer x:Name="PART_ContentHost"
Margin="{TemplateBinding Padding}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsFocused" Value="True">
<Setter TargetName="border" Property="BorderBrush" Value="{StaticResource AccentBrush}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.5"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<!-- ============================================ -->
<!-- ComboBox Style -->
<!-- ============================================ -->
Expand Down
35 changes: 35 additions & 0 deletions Dashboard/Themes/DarkTheme.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,41 @@
</Setter>
</Style>

<!-- ============================================ -->
<!-- PasswordBox Style -->
<!-- ============================================ -->
<Style TargetType="PasswordBox">
<Setter Property="Background" Value="{StaticResource BackgroundDarkBrush}"/>
<Setter Property="Foreground" Value="{StaticResource ForegroundBrush}"/>
<Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="6,4"/>
<Setter Property="CaretBrush" Value="{StaticResource ForegroundBrush}"/>
<Setter Property="SelectionBrush" Value="{StaticResource AccentBrush}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="PasswordBox">
<Border x:Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="3">
<ScrollViewer x:Name="PART_ContentHost"
Margin="{TemplateBinding Padding}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsFocused" Value="True">
<Setter TargetName="border" Property="BorderBrush" Value="{StaticResource AccentBrush}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.5"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<!-- ============================================ -->
<!-- ComboBox Style -->
<!-- ============================================ -->
Expand Down
Loading
Loading