Commit f361b74f authored by Thomas's avatar Thomas
Browse files

Adjust patch dialog view

parent 0b3c291c
......@@ -30,8 +30,7 @@ namespace pEp.DPE
private void DpeWebServer_RequestReceived(object sender, DPEWebServerEventArgs e)
{
// If the request is a patch, suggest it. Otherwise, ignore request.
Patch patch;
if ((patch = Patch.Deserialize(e.Request)) != null)
if (Patch.Deserialize(e.Request) is Patch patch)
{
this.Suggested(patch, new PEPIdentity("patchadmin@pep.security"));
}
......
......@@ -106,6 +106,7 @@
Grid.Column="0"
Grid.ColumnSpan="3"
Content="Configuration management"
FontWeight="Thin"
Margin="10,5"
FontSize="25" />
<Image Grid.Row="0"
......@@ -159,7 +160,7 @@
Background="{Binding CommitBackground}"
Content="{Binding CommitMessage}"
Margin="10,5"
Padding="10"
Padding="5,10"
Grid.Row="5" />
<Label Grid.Row="6"
Grid.Column="0"
......
......@@ -6,6 +6,9 @@
xmlns:p="clr-namespace:pEp.Properties"
xmlns:ui="clr-namespace:pEp.UI"
xmlns:vm="clr-namespace:pEp.UI.ViewModels"
Background="White"
Width="1000"
Height="700"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=vm:PatchViewModel}"
d:DesignHeight="450" d:DesignWidth="800">
......@@ -24,22 +27,26 @@
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="3*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!--Overlay during API calls-->
<Rectangle Grid.Column="0"
Grid.ColumnSpan="3"
Grid.ColumnSpan="2"
Grid.Row="0"
Grid.RowSpan="5"
Grid.RowSpan="10"
Grid.ZIndex="99"
Fill="White"
Opacity="0.7"
......@@ -48,10 +55,12 @@
Visibility="{Binding IsLoading, Converter={StaticResource BoolToVisibility}}" />
<!--Loading animation during API calls-->
<Image Grid.Column="0"
Grid.ColumnSpan="3"
Grid.ColumnSpan="2"
Grid.Row="0"
Grid.RowSpan="5"
Grid.RowSpan="10"
Grid.ZIndex="100"
Width="100"
Height="41"
Visibility="{Binding IsLoading, Converter={StaticResource BoolToVisibility}}"
Source="pack://application:,,,/pEp;component/Resources/ImageLogoMedium.png"
HorizontalAlignment="Center"
......@@ -79,14 +88,21 @@
</Image>
<Label Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="3"
Content="Change config"
Margin="10"/>
<ListBox Grid.Row="1"
Grid.ColumnSpan="2"
Content="Change configuration"
FontWeight="Thin"
Margin="10,5"
FontSize="25"/>
<Label Grid.Row="1"
Grid.Column="0"
Content="Files"
Background="#f2f2f2"
FontWeight="DemiBold"
Foreground="DarkSlateGray"
Margin="10,5"/>
<ListBox Grid.Row="2"
Grid.Column="0"
Margin="10"
Width="500"
Height="500"
Margin="10,0,10,5"
SelectedItem="{Binding SelectedFile}"
ItemsSource="{Binding ConfigFiles}">
<ListBox.ItemTemplate>
......@@ -97,42 +113,70 @@
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<StackPanel Grid.Row="1"
Grid.Column="1">
<Button Content="Add file"
Margin="5"
Style="{StaticResource StyleButtonGray}"
Command="{Binding AddOrEditFileCommand}"/>
<Button Content="Remove file"
Margin="5"
Style="{StaticResource StyleButtonGray}"
Command="{Binding RemoveButtonCommand}" />
</StackPanel>
<FlowDocumentScrollViewer Grid.Column="2"
Grid.Row="1"
Width="500"
Height="500"
<Label Grid.Row="1"
Grid.Column="1"
Content="Changes"
Background="#f2f2f2"
FontWeight="DemiBold"
Foreground="DarkSlateGray"
Margin="10,5"/>
<FlowDocumentScrollViewer Grid.Column="1"
Grid.Row="2"
Grid.RowSpan="5"
BorderBrush="Black"
BorderThickness="1"
Margin="5,10,10,10"
Margin="10,0,10,5"
HorizontalScrollBarVisibility="Auto"
Document="{Binding FormattedDiff}"/>
<Button Grid.Row="3"
Grid.Column="0"
Margin="10,5"
Content="Add file"
HorizontalAlignment="Right"
Style="{StaticResource StyleButtonGray}"
Command="{Binding AddOrEditFileCommand}"/>
<Label Grid.Row="4"
Grid.Column="0"
Content="Apply to"
Background="#f2f2f2"
FontWeight="DemiBold"
Foreground="DarkSlateGray"
Margin="10,10,10,5"/>
<ListBox Grid.Row="5"
Grid.Column="0"
Margin="10,0,10,5"
ItemsSource="{Binding ApplyTo}">
<ListBox.ItemTemplate>
<DataTemplate>
<ContentControl MouseDoubleClick="ListBoxItem_MouseDoubleClick">
<Label Content="{Binding Address}" />
</ContentControl>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Button Grid.Row="6"
Grid.Column="0"
Margin="10,5"
Content="Add machine"
HorizontalAlignment="Right"
Style="{StaticResource StyleButtonGray}"
Command="{Binding AddOrEditFileCommand}"/>
<ui:TextBoxWithPlaceholder Grid.Column="0"
Grid.ColumnSpan="3"
Grid.Row="2"
Grid.ColumnSpan="2"
Grid.Row="7"
Text="{Binding CommitMessage, UpdateSourceTrigger=PropertyChanged}"
IsValidInput="{Binding IsCommitMessageValid}"
Placeholder="Commit message"
Margin="5,10,10,10" />
Margin="0,10" />
<ui:TextBoxWithPlaceholder Grid.Column="0"
Grid.ColumnSpan="3"
Grid.Row="3"
Grid.ColumnSpan="2"
Grid.Row="8"
Text="{Binding Tag, UpdateSourceTrigger=PropertyChanged}"
Placeholder="Tag (optional)"
Margin="5,10,10,10" />
Margin="0,10" />
<StackPanel Grid.Column="0"
Grid.ColumnSpan="3"
Grid.Row="4"
Grid.ColumnSpan="2"
Grid.Row="9"
Orientation="Horizontal"
HorizontalAlignment="Center"
Margin="10">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment