-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to filter and compact history list for current action
- Loading branch information
1 parent
26dd7f1
commit 9e0fa97
Showing
3 changed files
with
99 additions
and
45 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
src/ScriptRunner/ScriptRunner.GUI/ViewModels/ExecutionLogAction.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,35 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text.Json.Serialization; | ||
using Avalonia.Controls.Documents; | ||
using Avalonia.Media; | ||
using DynamicData; | ||
|
||
namespace ScriptRunner.GUI.ViewModels; | ||
|
||
public record ExecutionLogAction(DateTime Timestamp, string Source, string Name, Dictionary<string, string> Parameters) | ||
{ | ||
[JsonIgnore] | ||
public InlineCollection ParametersDescription => new InlineCollection() | ||
{ | ||
new Run("["), | ||
|
||
Parameters.SelectMany((x,i) => | ||
{ | ||
var value = x.Value?.StartsWith("!!vault:") == true ? "*****" : x.Value; | ||
return new[] | ||
{ | ||
new Run($"{x.Key} = "), | ||
new Run(value) | ||
{ | ||
Foreground = Brushes.LightGreen, | ||
}, | ||
new Run( i< Parameters.Count -1?", ":"") | ||
}; | ||
}), | ||
new Run("]"), | ||
}; | ||
|
||
public string ParametersDescriptionString() => string.Join(", ", Parameters.OrderBy(x=>x.Key).Select(x => $"{x.Key} = {x.Value}")); | ||
}; |
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