<commit_before>﻿<UserControl x:Class="GSF.TimeSeries.Transport.UI.UserControls.SubscriberRequestUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" d:DesignHeight="650" d:DesignWidth="850"
             xmlns:vm="clr-namespace:GSF.TimeSeries.Transport.UI.ViewModels"
             xmlns:uc="clr-namespace:GSF.TimeSeries.Transport.UI.UserControls"
             xmlns:ui="clr-namespace:GSF.TimeSeries.UI;assembly=GSF.TimeSeries.UI.WPF"
             Background="Transparent" Loaded="SubscriberRequestUserControl_Loaded" Unloaded="SubscriberRequestUserControl_Unloaded">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/GSF.TimeSeries.UI.WPF;Component/Resources/CommonResource.xaml" />
            </ResourceDictionary.MergedDictionaries>
            
            <vm:SubscriberRequestViewModel x:Key="ViewModel" />
        </ResourceDictionary>
    </UserControl.Resources>

    <StackPanel Orientation="Vertical" HorizontalAlignment="Center" DataContext="{StaticResource ViewModel}">
        <Border CornerRadius="5" BorderThickness="2" Background="White" BorderBrush="Red" Visibility="{Binding ConnectivityMessageVisibility}">
            <TextBlock HorizontalAlignment="Center">Unable to contact the service. Some features on this page may not be available.</TextBlock>
        </Border>
        
        <GroupBox Header="Publisher Info">
            <Grid HorizontalAlignment="Center">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                
                <Label Grid.Row="0" Grid.Column="0" Content="Acronym" />
                <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Mode=TwoWay, Path=PublisherAcronym, UpdateSourceTrigger=PropertyChanged}" CharacterCasing="Upper" />
                <Label Grid.Row="0" Grid.Column="2" Content="Name" />
                <TextBox Grid.Row="0" Grid.Column="3" Text="{Binding Mode=TwoWay, Path=PublisherName}" />

                <Label Grid.Row="1" Grid.Column="0" Content="Hostname" />
                <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Mode=TwoWay, Path=Hostname}" />
                <Label Grid.Row="1" Grid.Column="2" Content="Port" />
                <TextBox Grid.Row="1" Grid.Column="3" Width="{StaticResource XXSmallItemSize}" Text="{Binding Mode=TwoWay, Path=PublisherPort}" />

                <Label Grid.Row="2" Grid.Column="0" Content="Security mode" />
                <StackPanel Grid.Row="2" Grid.Column="1" Margin="5">
                    <RadioButton GroupName="SecurityMode" Content="TLS" IsChecked="True" Checked="SecurityModeRadioButton_Checked" />
                    <RadioButton GroupName="SecurityMode" Content="Gateway" Checked="SecurityModeRadioButton_Checked" />
                </StackPanel>
                
                <Label Grid.Row="2" Grid.Column="2" Content="UDP Port" />
                <StackPanel Grid.Row="2" Grid.Column="3" Orientation="Horizontal" VerticalAlignment="Top">
                    <TextBox Width="{StaticResource XXSmallItemSize}" Text="{Binding Mode=TwoWay, Path=UdpDataChannelPort}" IsEnabled="{Binding ElementName=UdpCheckBox, Path=IsChecked}" />
                    <CheckBox Name="UdpCheckBox" IsChecked="{Binding Mode=TwoWay, Path=UseUdpDataChannel}">
                        <TextBlock FontSize="10" FontStyle="Italic">
                            Leave unchecked for TCP only.
                        </TextBlock>
                    </CheckBox>
                </StackPanel>
            </Grid>
        </GroupBox>

        <GroupBox Header="Subscriber Info">
            <Grid HorizontalAlignment="Center">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <Label Grid.Row="0" Grid.Column="0" Content="Acronym" />
                <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Mode=TwoWay, Path=SubscriberAcronym}" />
                <Label Grid.Row="0" Grid.Column="2" Content="Name" />
                <TextBox Grid.Row="0" Grid.Column="3" Text="{Binding Mode=TwoWay, Path=SubscriberName}" />

                <Label Grid.Row="1" Grid.Column="0" Content="Valid IP Addresses" />
                <TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Width="{StaticResource XXXLargeItemSize}" Text="{Binding Mode=TwoWay, Path=ValidIPAddresses}" />
            </Grid>
        </GroupBox>

        <GroupBox Header="TLS" IsEnabled="{Binding TransportLayerSecuritySelected}">
            <StackPanel HorizontalAlignment="Center">
                <TextBlock Width="{StaticResource XXXLargeItemSize}" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap">
                    Remote certificate path should be the path on the server, relative to the trusted certificates path,
                    where the service will be able to locate the certificate. The browse button may not be relevant.
                </TextBlock>
                
                <Grid Margin="0,10,0,0" HorizontalAlignment="Center">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" /><commit_msg>GSF.TimeSeries.Transport.UI.WPF: On SubscriberRequest pag, require subscriber acronym to be upper-case<commit_after>﻿<UserControl x:Class="GSF.TimeSeries.Transport.UI.UserControls.SubscriberRequestUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" d:DesignHeight="650" d:DesignWidth="850"
             xmlns:vm="clr-namespace:GSF.TimeSeries.Transport.UI.ViewModels"
             xmlns:uc="clr-namespace:GSF.TimeSeries.Transport.UI.UserControls"
             xmlns:ui="clr-namespace:GSF.TimeSeries.UI;assembly=GSF.TimeSeries.UI.WPF"
             Background="Transparent" Loaded="SubscriberRequestUserControl_Loaded" Unloaded="SubscriberRequestUserControl_Unloaded">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/GSF.TimeSeries.UI.WPF;Component/Resources/CommonResource.xaml" />
            </ResourceDictionary.MergedDictionaries>
            
            <vm:SubscriberRequestViewModel x:Key="ViewModel" />
        </ResourceDictionary>
    </UserControl.Resources>

    <StackPanel Orientation="Vertical" HorizontalAlignment="Center" DataContext="{StaticResource ViewModel}">
        <Border CornerRadius="5" BorderThickness="2" Background="White" BorderBrush="Red" Visibility="{Binding ConnectivityMessageVisibility}">
            <TextBlock HorizontalAlignment="Center">Unable to contact the service. Some features on this page may not be available.</TextBlock>
        </Border>
        
        <GroupBox Header="Publisher Info">
            <Grid HorizontalAlignment="Center">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                
                <Label Grid.Row="0" Grid.Column="0" Content="Acronym" />
                <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Mode=TwoWay, Path=PublisherAcronym, UpdateSourceTrigger=PropertyChanged}" CharacterCasing="Upper" />
                <Label Grid.Row="0" Grid.Column="2" Content="Name" />
                <TextBox Grid.Row="0" Grid.Column="3" Text="{Binding Mode=TwoWay, Path=PublisherName}" />

                <Label Grid.Row="1" Grid.Column="0" Content="Hostname" />
                <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Mode=TwoWay, Path=Hostname}" />
                <Label Grid.Row="1" Grid.Column="2" Content="Port" />
                <TextBox Grid.Row="1" Grid.Column="3" Width="{StaticResource XXSmallItemSize}" Text="{Binding Mode=TwoWay, Path=PublisherPort}" />

                <Label Grid.Row="2" Grid.Column="0" Content="Security mode" />
                <StackPanel Grid.Row="2" Grid.Column="1" Margin="5">
                    <RadioButton GroupName="SecurityMode" Content="TLS" IsChecked="True" Checked="SecurityModeRadioButton_Checked" />
                    <RadioButton GroupName="SecurityMode" Content="Gateway" Checked="SecurityModeRadioButton_Checked" />
                </StackPanel>
                
                <Label Grid.Row="2" Grid.Column="2" Content="UDP Port" />
                <StackPanel Grid.Row="2" Grid.Column="3" Orientation="Horizontal" VerticalAlignment="Top">
                    <TextBox Width="{StaticResource XXSmallItemSize}" Text="{Binding Mode=TwoWay, Path=UdpDataChannelPort}" IsEnabled="{Binding ElementName=UdpCheckBox, Path=IsChecked}" />
                    <CheckBox Name="UdpCheckBox" IsChecked="{Binding Mode=TwoWay, Path=UseUdpDataChannel}">
                        <TextBlock FontSize="10" FontStyle="Italic">
                            Leave unchecked for TCP only.
                        </TextBlock>
                    </CheckBox>
                </StackPanel>
            </Grid>
        </GroupBox>

        <GroupBox Header="Subscriber Info">
            <Grid HorizontalAlignment="Center">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <Label Grid.Row="0" Grid.Column="0" Content="Acronym" />
                <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Mode=TwoWay, Path=SubscriberAcronym}" CharacterCasing="Upper"/>
                <Label Grid.Row="0" Grid.Column="2" Content="Name" />
                <TextBox Grid.Row="0" Grid.Column="3" Text="{Binding Mode=TwoWay, Path=SubscriberName}" />

                <Label Grid.Row="1" Grid.Column="0" Content="Valid IP Addresses" />
                <TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Width="{StaticResource XXXLargeItemSize}" Text="{Binding Mode=TwoWay, Path=ValidIPAddresses}" />
            </Grid>
        </GroupBox>

        <GroupBox Header="TLS" IsEnabled="{Binding TransportLayerSecuritySelected}">
            <StackPanel HorizontalAlignment="Center">
                <TextBlock Width="{StaticResource XXXLargeItemSize}" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap">
                    Remote certificate path should be the path on the server, relative to the trusted certificates path,
                    where the service will be able to locate the certificate. The browse button may not be relevant.
                </TextBlock>
                
                <Grid Margin="0,10,0,0" HorizontalAlignment="Center">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
{'fraction_non_alphanumeric': 0.12386938525218458, 'fraction_numerical': 0.010577954928713782, 'mean_word_length': 2.2511836531273364, 'pattern_counts': {'":': 0, '<': 161, '<?xml version=': 0, '>': 161, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5633433', 'n_tokens_mistral': 3543, 'n_tokens_neox': 3194, 'n_words': 590}