Files
DBAdmin/toolbox/UI/MainWindow.xaml
T
2026-06-11 10:09:01 +00:00

80 lines
4.4 KiB
XML

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="DBAToolBox - MS SQL Management" Height="550" Width="850" Background="#F0F0F0">
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Header -->
<TextBlock Text="DBAToolBox" FontSize="24" FontWeight="Bold" Foreground="#2D3E50" Margin="0,0,0,10"/>
<!-- Main Workspace divided into Left (Tree View) and Right (Details) -->
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="220" MinWidth="180"/>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Left Panel: SQL Servers Tree -->
<GroupBox Header="SQL Server Directory" Grid.Column="0" Margin="0,0,5,0" Foreground="#2D3E50" FontWeight="SemiBold">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TreeView x:Name="tvServers" Margin="0,0,0,5" Background="White" BorderBrush="#CCCCCC" BorderThickness="1">
<!-- Items will be populated dynamically from PowerShell -->
</TreeView>
<!-- Buttons to manage servers list -->
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button x:Name="btnAddServer" Content="Add Server" Grid.Column="0" Margin="0,0,3,0" Padding="5,4" Background="#007ACC" Foreground="White" BorderThickness="0" FontWeight="Normal" Cursor="Hand"/>
<Button x:Name="btnRemoveServer" Content="Remove" Grid.Column="1" Margin="3,0,0,0" Padding="5,4" Background="#D13438" Foreground="White" BorderThickness="0" FontWeight="Normal" Cursor="Hand"/>
</Grid>
</Grid>
</GroupBox>
<!-- GridSplitter to resize columns -->
<GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" Background="#D8D8D8" ResizeBehavior="PreviousAndNext" Cursor="SizeWE"/>
<!-- Right Panel: Connection and Main Workspace -->
<Grid Grid.Column="2" Margin="10,0,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Information/Connection Panel (Hidden until a server/db is selected) -->
<Grid x:Name="gridDetails" Grid.Row="0" Visibility="Collapsed">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Connection Panel -->
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,0,0,10">
<Label Content="Server Name:" VerticalAlignment="Center" FontWeight="SemiBold"/>
<TextBox x:Name="txtServerName" Width="250" VerticalAlignment="Center" Margin="5,0,10,0" Padding="4"/>
<Button x:Name="btnConnect" Content="Connect &amp; Test" Width="120" Padding="5" Background="#007ACC" Foreground="White" BorderThickness="0" Cursor="Hand"/>
</StackPanel>
<!-- Main Content Area -->
<GroupBox Grid.Row="1" Header="Server Information" Margin="0,0,0,10" Foreground="#2D3E50" FontWeight="SemiBold">
<DataGrid x:Name="dgServerInfo" AutoGenerateColumns="True" IsReadOnly="True" Background="White" BorderBrush="#CCCCCC" Margin="5"/>
</GroupBox>
</Grid>
<!-- Log Area -->
<TextBox Grid.Row="1" x:Name="txtLogs" Height="120" IsReadOnly="True" VerticalScrollBarVisibility="Auto" Background="#E8E8E8" FontFamily="Consolas" FontSize="11" TextWrapping="Wrap" BorderBrush="#CCCCCC" Padding="5"/>
</Grid>
</Grid>
</Grid>
</Window>