123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224 |
- <UserControl
- x:Class="ShakerManger.View.SqlPageView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:hc="https://handyorg.github.io/handycontrol"
- xmlns:local="clr-namespace:ShakerManger.View"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:model="clr-namespace:Shaker.Model;assembly=Shaker"
- xmlns:vm="clr-namespace:ShakerManger.ViewModel"
- d:DataContext="{d:DesignInstance {x:Type vm:SqlPageViewModel}}"
- d:DesignHeight="450"
- d:DesignWidth="800"
- DataContext="{Binding SqlPage}"
- IsEnabled="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=IsAnonymous, Converter={StaticResource Boolean2BooleanReConverter}}"
- mc:Ignorable="d">
- <UserControl.Style>
- <Style TargetType="UserControl">
- <Style.Triggers>
- <DataTrigger Binding="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=UserType}" Value="{x:Static model:UserType.SystemAdministrator}">
- <Setter Property="IsEnabled" Value="True" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=UserType}" Value="{x:Static model:UserType.ClientUser}">
- <Setter Property="IsEnabled" Value="False" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=UserType}" Value="{x:Static model:UserType.SystemUser}">
- <Setter Property="IsEnabled" Value="False" />
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </UserControl.Style>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="80" />
- <RowDefinition />
- <RowDefinition />
- </Grid.RowDefinitions>
- <Border Background="{StaticResource SystemItemsSelectBackColor}">
- <TextBlock Grid.Row="0" Margin="10">
- <Run
- FontFamily="Arial Black"
- FontSize="22"
- Foreground="{StaticResource MainBrush}"
- Text="数据库配置说明" />
- <LineBreak />
- <LineBreak />
- <Run
- FontSize="16"
- Foreground="{StaticResource MainBrush}"
- Text="当前试验数据存储需要使用MongoDB数据库,如数据库没有账号密码则无需填写,设置成功后需要重启软件方可生效" />
- </TextBlock>
- </Border>
- <Grid
- Grid.Row="1"
- Width="830"
- Height="324"
- Margin="0,20,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Top">
- <Grid.RowDefinitions>
- <RowDefinition Height="46" />
- <RowDefinition Height="46" />
- <RowDefinition Height="46" />
- <RowDefinition Height="46" />
- <RowDefinition Height="auto" />
- <RowDefinition Height="46" />
- </Grid.RowDefinitions>
- <StackPanel
- x:Name="first"
- Height="34"
- Orientation="Horizontal">
- <TextBlock
- Width="94"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="16">
- <Run Foreground="Red" Text="*" />
- <Run Text="数据库地址:" />
- </TextBlock>
- <hc:TextBox
- Width="720"
- Margin="10,0,0,0"
- Background="Transparent"
- CaretBrush="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Foreground}"
- FontSize="16"
- TabIndex="0"
- Text="{Binding IP, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
- </StackPanel>
- <StackPanel
- Grid.Row="1"
- Height="{Binding ElementName=first, Path=Height}"
- Orientation="Horizontal">
- <TextBlock
- Width="94"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="16">
- <Run Foreground="Red" Text="*" />
- <Run Text="数据库端口:" />
- </TextBlock>
- <hc:NumericUpDown
- Width="120"
- Margin="10,0,0,0"
- Background="Transparent"
- CaretBrush="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Foreground}"
- FontSize="16"
- Maximum="65535"
- Minimum="1"
- TabIndex="1"
- Value="{Binding Port, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
- </StackPanel>
- <StackPanel
- Grid.Row="2"
- Height="{Binding ElementName=first, Path=Height}"
- Orientation="Horizontal">
- <TextBlock
- Width="94"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="16">
- <Run Foreground="Red" Text="*" />
- <Run Text="数据库名:" />
- </TextBlock>
- <TextBox
- Width="720"
- Margin="10,0,0,0"
- Background="Transparent"
- CaretBrush="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Foreground}"
- FontSize="16"
- TabIndex="2"
- Text="{Binding DbName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
- </StackPanel>
- <CheckBox
- Grid.Row="3"
- Content="匿名登录"
- FontSize="16"
- IsChecked="{Binding Anonymous}"
- TabIndex="3" />
- <Grid
- Grid.Row="4"
- Height="92"
- Visibility="{Binding Anonymous, Converter={StaticResource Boolean2VisibilityReConverter}}">
- <Grid.RowDefinitions>
- <RowDefinition />
- <RowDefinition />
- </Grid.RowDefinitions>
- <StackPanel
- Grid.Row="0"
- Height="{Binding ElementName=first, Path=Height}"
- Orientation="Horizontal">
- <TextBlock
- Width="94"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="16">
- <Run Foreground="Red" Text="*" />
- <Run Text="数据库账号:" />
- </TextBlock>
- <TextBox
- Width="720"
- Margin="10,0,0,0"
- Background="Transparent"
- CaretBrush="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Foreground}"
- FontSize="16"
- TabIndex="4"
- Text="{Binding UserName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
- </StackPanel>
- <StackPanel
- Grid.Row="1"
- Height="{Binding ElementName=first, Path=Height}"
- Orientation="Horizontal">
- <Label
- Width="94"
- Padding="0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- HorizontalContentAlignment="Right"
- Background="Transparent"
- BorderBrush="Transparent"
- BorderThickness="0"
- Content="数据库密码:"
- FontSize="16" />
- <hc:PasswordBox
- Width="720"
- Margin="10,0,0,0"
- Background="Transparent"
- CaretBrush="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Foreground}"
- FontSize="16"
- IsSafeEnabled="True"
- TabIndex="5"
- UnsafePassword="{Binding UserName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
- </StackPanel>
- </Grid>
- <UniformGrid
- Grid.Row="5"
- Columns="2"
- Rows="1">
- <Button
- Width="120"
- Height="34"
- hc:IconElement.Geometry="{StaticResource TestGeometry}"
- hc:IconElement.Height="20"
- hc:IconElement.Width="20"
- Command="{Binding TestConnectCommand}"
- Content="测试连接"
- FontSize="16"
- Style="{StaticResource HasIconButton}"
- TabIndex="6" />
- <Button
- Width="160"
- Height="34"
- hc:IconElement.Geometry="{StaticResource SaveGeometry}"
- hc:IconElement.Height="20"
- hc:IconElement.Width="20"
- Command="{Binding SaveCommand}"
- Content="保存配置并重启"
- FontSize="16"
- Style="{StaticResource HasIconButton}"
- TabIndex="7" />
- </UniformGrid>
- </Grid>
- </Grid>
- </UserControl>
|