-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added help menu option to view debug log file
- Loading branch information
Showing
9 changed files
with
163 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@inherits Base.BaseModal | ||
|
||
<dialog id="debugLogDialog" @ref="ElementReference"> | ||
<div class="dialog-group"> | ||
<div class="flex-column-scroll"> | ||
@if (_data.Any()) | ||
{ | ||
@foreach(var line in _data) | ||
{ | ||
<text>@line</text><br /> | ||
} | ||
} | ||
else | ||
{ | ||
<text>Log is Empty...</text> | ||
} | ||
</div> | ||
|
||
<div class="footer-group"> | ||
<div> | ||
<button class="button" @onclick="Refresh">Refresh</button> | ||
<button class="button" @onclick="Clear">Clear</button> | ||
</div> | ||
|
||
<button class="button" @onclick="Close">Exit</button> | ||
</div> | ||
</div> | ||
</dialog> |
50 changes: 50 additions & 0 deletions
50
src/EventLogExpert/Shared/Components/DebugLogModal.razor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// // Copyright (c) Microsoft Corporation. | ||
// // Licensed under the MIT License. | ||
|
||
using EventLogExpert.Eventing.Helpers; | ||
using EventLogExpert.UI.Store.Settings; | ||
using Microsoft.AspNetCore.Components; | ||
|
||
namespace EventLogExpert.Shared.Components; | ||
|
||
public partial class DebugLogModal | ||
{ | ||
private readonly List<string> _data = []; | ||
|
||
[Inject] private ITraceLogger TraceLogger { get; set; } = null!; | ||
|
||
protected internal override async Task Open() | ||
{ | ||
await Refresh(); | ||
|
||
await base.Open(); | ||
} | ||
|
||
protected override void OnInitialized() | ||
{ | ||
SubscribeToAction<SettingsAction.OpenDebugLog>(action => Open().AndForget()); | ||
|
||
base.OnInitialized(); | ||
} | ||
|
||
private async Task Clear() | ||
{ | ||
_data.Clear(); | ||
|
||
await TraceLogger.ClearAsync(); | ||
|
||
StateHasChanged(); | ||
} | ||
|
||
private async Task Refresh() | ||
{ | ||
_data.Clear(); | ||
|
||
await foreach (var line in TraceLogger.LoadAsync()) | ||
{ | ||
_data.Add(line); | ||
} | ||
|
||
StateHasChanged(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
dialog { | ||
height: 60%; | ||
min-width: 50rem; | ||
color: var(--clr-lightblue); | ||
|
||
border-color: var(--clr-statusbar); | ||
background-color: var(--background-dark); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters