Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2 from jibedoubleve/dev
Browse files Browse the repository at this point in the history
Release 1.1.0
  • Loading branch information
jibedoubleve authored Mar 5, 2018
2 parents daa13f2 + 9a21868 commit 2d5a480
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 7 deletions.
1 change: 1 addition & 0 deletions Probel.JsonReader.Business/Data/IFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ public interface IFilter
{
#region Properties

bool ShowTrace { get; }
bool ShowDebug { get; }
bool ShowError { get; }
bool ShowFatal { get; }
Expand Down
1 change: 1 addition & 0 deletions Probel.JsonReader.Business/Data/LogFilterExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public static class LogFilterExtensions
public static IEnumerable<LogModel> Filter(this IEnumerable<LogModel> models, int minutes, IFilter filter)
{
var levels = new List<string>();
if (filter.ShowTrace) { levels.Add("TRACE"); }
if (filter.ShowDebug) { levels.Add("DEBUG"); }
if (filter.ShowInfo) { levels.Add("INFO"); }
if (filter.ShowWarning) { levels.Add("WARN"); }
Expand Down
14 changes: 11 additions & 3 deletions Probel.JsonReader.Presentation/Services/SerialisationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ public bool IsLoggerVisible
get; set;
}

[JsonProperty]
public bool IsSortAscending { get; set; }

[JsonProperty]
public bool IsThreadIdVisible
{
Expand Down Expand Up @@ -114,27 +117,32 @@ public bool ShowInfo
get; set;
}

[JsonProperty]
public bool ShowTrace { get; set; }

[JsonProperty]
public bool ShowWarning
{
get; set;
}

[JsonProperty]
public bool IsSortAscending { get; set; }

#endregion Properties

#region Methods

public void Fill(SettingsViewModel vm)
{
vm.IsLoggerVisible = IsLoggerVisible;
vm.IsThreadIdVisible = IsThreadIdVisible;
vm.ShowDebug = ShowDebug;
vm.ShowInfo = ShowInfo;
vm.ShowWarning = ShowWarning;
vm.ShowTrace = ShowTrace;
vm.ShowError = ShowError;
vm.ShowFatal = ShowFatal;
vm.IsSortAscending = IsSortAscending;
}

#endregion Methods
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class SettingsViewModel : BindableBase, IFilter
private bool _showError = true;
private bool _showFatal = true;
private bool _showInfo = true;
private bool _showTrace;
private bool _showWarning = true;

#endregion Fields
Expand Down Expand Up @@ -75,6 +76,12 @@ public bool ShowInfo
set => SetProperty(ref _showInfo, value, nameof(ShowInfo));
}

public bool ShowTrace
{
get => _showTrace;
set => SetProperty(ref _showTrace, value, nameof(ShowTrace));
}

public bool ShowWarning
{
get => _showWarning;
Expand Down
34 changes: 32 additions & 2 deletions Probel.JsonReader.Presentation/Views/ShellView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@
<Setter Property="Margin" Value="5,5,0,5" />
</Style>
</StackPanel.Resources>
<ToggleButton Command="{Binding FilterCommand}" IsChecked="{Binding Settings.ShowTrace, UpdateSourceTrigger=PropertyChanged}">
<iconPacks:PackIconModern Kind="Eye" />
</ToggleButton>
<ToggleButton Command="{Binding FilterCommand}" IsChecked="{Binding Settings.ShowDebug, UpdateSourceTrigger=PropertyChanged}">
<iconPacks:PackIconModern Kind="Bug" />
</ToggleButton>
Expand All @@ -164,14 +167,41 @@
CanUserSortColumns="False"
GridLinesVisibility="Horizontal"
ItemsSource="{Binding Logs}"
SelectionMode="Single">
SelectionMode="Single" HorizontalGridLinesBrush="#0C000000" VerticalGridLinesBrush="#82000000" IsReadOnly="True">
<DataGrid.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
<ResourceDictionary>
<Style x:Key="{x:Type DataGridCell}" TargetType="{x:Type DataGridCell}">
<Setter Property="Background" Value="{x:Null}" />
<Setter Property="BorderBrush" Value="{x:Null}" />
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="{x:Null}" />
<Setter Property="Foreground" Value="{x:Static SystemColors.ControlTextBrush}"/>
<Setter Property="BorderBrush" Value="{x:Null}" />
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type DataGridRow}">
<Setter Property="Background" Value="{x:Null}" />
<Setter Property="BorderBrush" Value="{x:Null}" />
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="{x:Null}" />
<Setter Property="BorderBrush" Value="{x:Null}" />
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>
<!--<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextColorKey}" Color="Transparent" />-->
</DataGrid.Resources>
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Style.Triggers>
<DataTrigger Binding="{Binding Level}" Value="TRACE">
<Setter Property="Background" Value="#66C678DD"/>
</DataTrigger>
<DataTrigger Binding="{Binding Level}" Value="DEBUG">
<Setter Property="Background" Value="#98C379" />
</DataTrigger>
Expand Down
4 changes: 2 additions & 2 deletions Version.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
// [assembly: AssemblyVersion("1.0.*")]
using System.Reflection;

[assembly: AssemblyVersion("1.0.1")]
[assembly: AssemblyFileVersion("1.0.1")]
[assembly: AssemblyVersion("1.1.0")]
[assembly: AssemblyFileVersion("1.1.0")]

0 comments on commit 2d5a480

Please sign in to comment.