You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

139 lines
8.5 KiB
XML

<UserControl x:Class="StartServerWPF.Modules.Main.Views.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:StartServerWPF.Modules.Main.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="800"
xmlns:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<i:InvokeCommandAction Command="{Binding Path=LoadedCommand}"/>
</i:EventTrigger>
<i:EventTrigger EventName="Unloaded">
<i:InvokeCommandAction Command="{Binding Path=UnloadedCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="350"/>
<ColumnDefinition Width="23*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="150"/>
<RowDefinition Height="150*"/>
<RowDefinition Height="20"/>
</Grid.RowDefinitions>
<GroupBox Header="网络控制" Style="{StaticResource GroupBoxOriginal}" BorderThickness="3" Margin="1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<RadioButton GroupName="con" IsChecked="{Binding VPNIsConnect}" x:Name="rtnConnect" Content="连接" Grid.Row="0" VerticalAlignment="Center">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Checked">
<i:InvokeCommandAction Command="{Binding ConnectVPNCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</RadioButton>
<RadioButton GroupName="con" Content="断开连接" Grid.Column="1" VerticalAlignment="Center" IsChecked="True">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Checked">
<i:InvokeCommandAction Command="{Binding DisConnectVPNCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</RadioButton>
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center" >
<Button Content="检查状态" Command="{Binding GetVPNStatusCommand}" Margin="5,0,5,0"/>
<TextBlock Text="{Binding VPNStatus}" Foreground="{Binding VPNStatusForeColor}" VerticalAlignment="Center"/>
</StackPanel>
<Button Content="参数设置" Grid.Row="1" Command="{Binding SetVPNParaCommand}" VerticalAlignment="Center"/>
<Button Content="运行日志" Grid.Row="1" Grid.Column="1" Command="{Binding DisplayLogCommand}" VerticalAlignment="Center"/>
<TextBlock Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" Margin="5,0,5,0">
<Run Text="本机IP:"/>
<Run Text="{Binding VpnIP}"/>
</TextBlock>
</Grid>
</GroupBox>
<GroupBox Header="服务器控制" IsEnabled="{Binding ElementName=rtnConnect,Path=IsChecked}" Style="{StaticResource GroupBoxOriginal}" BorderThickness="3" Margin="1" Grid.Row="1" >
<Grid Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="30"/>
<RowDefinition Height="100*"/>
<RowDefinition Height="30"/>
</Grid.RowDefinitions>
<RadioButton GroupName="start" Content="一键启动" Grid.Column="0" VerticalAlignment="Center">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Checked">
<i:InvokeCommandAction Command="{Binding OneKeyStartCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</RadioButton>
<RadioButton GroupName="start" Content="全部关闭" IsChecked="True" Grid.Column="1" VerticalAlignment="Center">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Checked">
<i:InvokeCommandAction Command="{Binding OneKeyStopCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</RadioButton>
<Button Content="实时波形" Command="{Binding DisplayRealWavesCommand}" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Right"/>
<TextBlock Grid.Row="1" VerticalAlignment="Center" Grid.ColumnSpan="3">
<Run Text="启动时间:"/>
<Run Text="{Binding StartTime,StringFormat=yyyy-MM-dd HH:mm:ss}"/>
</TextBlock>
<TextBlock Grid.Row="2" Grid.ColumnSpan="3" VerticalAlignment="Center">
<Run Text="运行时间:"/>
<Run Text="{Binding RunTime,StringFormat=yyyy-MM-dd HH:mm:ss}"/>
</TextBlock>
<DockPanel Grid.Row="2" Grid.Column="2" >
<ComboBox DockPanel.Dock="Right" ItemsSource="{Binding IntervalTimesSource}" SelectedIndex="{Binding selectedIndex}" Text="{Binding ProMonInterval}" VerticalAlignment="Center"/>
<TextBlock Text="监隔间隔(s):" DockPanel.Dock="Right" VerticalAlignment="Center"/>
</DockPanel>
<ListBox Grid.Row="3" Grid.ColumnSpan="3" ItemsSource="{Binding ReciveDataSource}">
</ListBox>
<ProgressBar Grid.Row="4" Grid.ColumnSpan="3" VerticalAlignment="Bottom" IsIndeterminate="{Binding IsIndeterminate}" Foreground="Green" Value="0"/>
</Grid>
</GroupBox>
<Grid Grid.Column="1" Grid.RowSpan="3" >
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<UniformGrid Grid.Row="0" >
<RadioButton GroupName="A" Command="{Binding OutputItemsCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self},Path=Content}" Content="apmsProcessSlice" IsChecked="True"/>
<RadioButton GroupName="A" Command="{Binding OutputItemsCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self},Path=Content}" Content="apmsEvent"/>
<RadioButton GroupName="A" Command="{Binding OutputItemsCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self},Path=Content}" Content="toolsProcessSlice"/>
<RadioButton GroupName="A" Command="{Binding OutputItemsCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self},Path=Content}" Content="toolsEvent"/>
</UniformGrid>
<ListBox Grid.Row="1" Background="LightGray" ItemsSource="{Binding OutPutItemsSource}">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding }" TextWrapping="Wrap"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
<!--<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Bottom" IsEnabled="False">
<Button Content="查询" Command="{Binding QueryDataCommand}"/>
<Button Content="新增" Command="{Binding InsertDataCommand}"/>
</StackPanel>-->
<!--<TextBlock Grid.Row="2" Text="Version 2023.05.17" Margin="10,0,0,0"/>-->
</Grid>
</UserControl>