-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathAddServerDialog.xaml
More file actions
247 lines (225 loc) · 15.3 KB
/
AddServerDialog.xaml
File metadata and controls
247 lines (225 loc) · 15.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<Window x:Class="PerformanceMonitorDashboard.AddServerDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Add SQL Server"
Width="500"
WindowStartupLocation="Manual"
ResizeMode="CanResizeWithGrip"
Background="{DynamicResource BackgroundBrush}"
Foreground="{DynamicResource ForegroundBrush}">
<Grid Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ScrollViewer Grid.Row="0" VerticalScrollBarVisibility="Auto">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Header -->
<TextBlock Grid.Row="0" Text="Add SQL Server Connection" FontSize="18" FontWeight="Bold" Margin="0,0,0,15"
Foreground="{DynamicResource ForegroundBrush}"/>
<!-- Form Fields -->
<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"/>
<!-- 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>
<!-- 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}"/>
<TextBox x:Name="UsernameTextBox" Margin="0,0,0,8"/>
<TextBlock Text="Password:" Margin="0,0,0,4"
Foreground="{DynamicResource ForegroundBrush}"/>
<PasswordBox x:Name="PasswordBox"/>
</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>
<!-- 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}"/>
<ComboBox x:Name="EncryptModeComboBox" Width="150"
SelectedIndex="1"
ToolTip="Optional: Encrypt if server supports it
Mandatory: Always encrypt (fails if not supported)
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.
Uncheck for stricter security (requires valid certificate)."
Margin="0,0,0,6"/>
<!-- Read-Only Intent -->
<CheckBox x:Name="ReadOnlyIntentCheckBox"
Content="Read-only intent (for AG listeners and readable replicas)"
Foreground="{DynamicResource ForegroundBrush}" Margin="0,0,0,6"
ToolTip="Sets ApplicationIntent=ReadOnly. Required when connecting via an AG listener or Azure failover group endpoint to route to a readable secondary."/>
<!-- Multi-Subnet Failover -->
<CheckBox x:Name="MultiSubnetFailoverCheckBox"
Content="Multi-subnet failover (for AG listeners and FCIs)"
Foreground="{DynamicResource ForegroundBrush}" Margin="0,0,0,6"
ToolTip="Sets MultiSubnetFailover=true. Connects to all IPs in parallel during failover. Recommended for AG listeners and failover cluster instances spanning multiple subnets."/>
<!-- Is Favorite -->
<CheckBox x:Name="IsFavoriteCheckBox" Content="Mark as favorite (appears at top of list)"
Foreground="{DynamicResource ForegroundBrush}" Margin="0,0,0,6"/>
<!-- Monthly Cost -->
<StackPanel Orientation="Horizontal" Margin="0,0,0,6">
<TextBlock Text="Monthly Cost ($):" Width="110" VerticalAlignment="Center"
Foreground="{DynamicResource ForegroundBrush}"/>
<TextBox x:Name="MonthlyCostTextBox" Width="100" TextAlignment="Right" Text="0"
ToolTip="What this server costs per month (license, compute, storage combined). Used for FinOps cost attribution. Leave 0 to hide cost columns."/>
</StackPanel>
<!-- Description -->
<TextBlock Text="Description (optional):" Margin="0,4,0,4"
Foreground="{DynamicResource ForegroundBrush}"/>
<TextBox x:Name="DescriptionTextBox" Height="60" TextWrapping="Wrap"
AcceptsReturn="True" VerticalScrollBarVisibility="Auto"/>
</StackPanel>
</StackPanel>
<!-- Database Status Panel -->
<Border x:Name="DatabaseStatusPanel" Grid.Row="2" Visibility="Collapsed"
Background="{DynamicResource BackgroundLightBrush}"
CornerRadius="4" Padding="12" Margin="0,0,0,10">
<StackPanel>
<TextBlock x:Name="ConnectionInfoText" TextWrapping="Wrap" Margin="0,0,0,4"
FontWeight="SemiBold"
Foreground="{DynamicResource ForegroundBrush}"/>
<TextBlock x:Name="DatabaseStatusText" TextWrapping="Wrap" Margin="0,0,0,8"
Foreground="{DynamicResource ForegroundBrush}"/>
<StackPanel Orientation="Horizontal" Margin="0,0,0,4">
<Button x:Name="InstallUpgradeButton" Content="Install Now"
Style="{StaticResource AccentButton}"
Click="InstallOrUpgrade_Click" Margin="0,0,12,0"/>
<TextBlock x:Name="SkipInstallText" Text="Skip, just add server"
VerticalAlignment="Center" Cursor="Hand"
Foreground="{DynamicResource ForegroundMutedBrush}"
MouseLeftButtonUp="SkipInstall_Click">
<TextBlock.TextDecorations>
<TextDecoration Location="Underline"/>
</TextBlock.TextDecorations>
</TextBlock>
</StackPanel>
</StackPanel>
</Border>
<!-- Installation Progress Panel -->
<StackPanel x:Name="InstallationPanel" Grid.Row="3" Visibility="Collapsed" Margin="0,0,0,10">
<!-- Advanced Options Expander (shown before install starts) -->
<Expander x:Name="AdvancedOptionsExpander" Header="Advanced Options" IsExpanded="False"
Foreground="{DynamicResource ForegroundBrush}" Margin="0,0,0,8">
<StackPanel Margin="16,8,0,0">
<CheckBox x:Name="CleanInstallCheckBox"
Content="Perform clean install (drops existing database)"
Foreground="{DynamicResource ForegroundBrush}" Margin="0,0,0,4"/>
<CheckBox x:Name="ResetScheduleCheckBox"
Content="Reset collection schedule to defaults"
Foreground="{DynamicResource ForegroundBrush}" Margin="0,0,0,4"/>
<CheckBox x:Name="ValidationCheckBox"
Content="Run validation after install" IsChecked="True"
Foreground="{DynamicResource ForegroundBrush}" Margin="0,0,0,4"/>
<CheckBox x:Name="InstallDepsCheckBox"
Content="Install community dependencies" IsChecked="True"
Foreground="{DynamicResource ForegroundBrush}" Margin="0,0,0,4"/>
</StackPanel>
</Expander>
<ProgressBar x:Name="InstallProgressBar" Height="6" Margin="0,0,0,6"
Minimum="0" Maximum="100" Value="0"
Foreground="{DynamicResource AccentBrush}"
Background="{DynamicResource BackgroundLighterBrush}"/>
<TextBlock x:Name="InstallStatusText" TextWrapping="Wrap" Margin="0,0,0,6"
Foreground="{DynamicResource ForegroundBrush}"/>
<TextBox x:Name="InstallLogTextBox" FontFamily="Consolas" FontSize="11"
MaxHeight="180" IsReadOnly="True" TextWrapping="Wrap"
VerticalScrollBarVisibility="Auto"
Background="{DynamicResource BackgroundDarkBrush}"
Foreground="{DynamicResource ForegroundBrush}"
BorderBrush="{DynamicResource BorderBrush}"
Margin="0,0,0,6"/>
<Button x:Name="CancelInstallButton" Content="Cancel" Click="CancelInstall_Click"
HorizontalAlignment="Left" Margin="0,0,0,4"/>
</StackPanel>
<!-- Monitoring Credentials Panel -->
<Border x:Name="MonitoringCredsPanel" Grid.Row="4" Visibility="Collapsed"
Background="{DynamicResource BackgroundLightBrush}"
CornerRadius="4" Padding="12" Margin="0,0,0,10">
<StackPanel>
<TextBlock Text="The installer used your credentials to set up the database. You can use different credentials for ongoing Dashboard monitoring if needed."
TextWrapping="Wrap" Margin="0,0,0,8"
Foreground="{DynamicResource ForegroundBrush}"/>
<CheckBox x:Name="UseSameCredsCheckBox"
Content="Use same credentials for monitoring" IsChecked="True"
Foreground="{DynamicResource ForegroundBrush}"
Checked="UseSameCredsCheckBox_Changed"
Unchecked="UseSameCredsCheckBox_Changed"
Margin="0,0,0,8"/>
<StackPanel x:Name="MonitorCredsFieldsPanel" Visibility="Collapsed">
<TextBlock Text="Monitoring Username:" Margin="0,0,0,4"
Foreground="{DynamicResource ForegroundBrush}"/>
<TextBox x:Name="MonitorUsernameTextBox" Margin="0,0,0,8"/>
<TextBlock Text="Monitoring Password:" Margin="0,0,0,4"
Foreground="{DynamicResource ForegroundBrush}"/>
<PasswordBox x:Name="MonitorPasswordBox"/>
</StackPanel>
</StackPanel>
</Border>
<!-- Status -->
<TextBlock x:Name="StatusText" Grid.Row="5"
Foreground="{DynamicResource ForegroundMutedBrush}"
TextWrapping="Wrap" Margin="0,8,0,0" Visibility="Collapsed"/>
</Grid>
</ScrollViewer>
<!-- Buttons pinned to bottom -->
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,15,0,0">
<Button x:Name="ViewReportButton" Content="View Report" Margin="0,0,8,0"
Click="ViewReport_Click" Visibility="Collapsed"/>
<Button x:Name="CheckForUpdatesButton" Content="Check for Updates" Margin="0,0,8,0" Click="CheckForUpdates_Click"/>
<Button x:Name="TestConnectionButton" Content="Test Connection" Margin="0,0,8,0" Click="TestConnection_Click"/>
<Button x:Name="SaveButton" Content="Save" MinWidth="80" Height="30" Padding="12,0" 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>
</Window>