using ConsoleMonster; using ConsoleMonster.Layout; using ConsoleMonster.Presenters; using ConsoleMonster.Widgets; // A fixture shaped like assessment results. It never contacts the sample hosts. CheckResult[] checks = new CheckResult[] { new("Replication", "dc-west-01", "Pass", "All partners responded"), new("Disk capacity", "dc-west-01", "Warn", "14% free on the system volume"), new("Name resolution", "dc-east-02", "Fail", "No DNS response before the deadline") }; var table = Ui.Table(checks) .Column(check => check.Check) .Column(check => check.Target) .Column(check => check.Status, column => column.Presenter(CellPresenters.StatusWord)) .Column(check => check.Detail) .Expand(); string source = ("# Check fixture\nfunction Test-NameResolution {\n param([string] $Target)\n " + "Resolve-DnsName -Name $Target -ErrorAction Stop\n}"); var excerpt = CodeView.FromLines(source, 2, 5, "PowerShell").Title("Name resolution check"); excerpt.HighlightLines(4); Rows report = Ui.Rows().Gap(1).Content(rowsContent => { rowsContent.Rule("[accent bold]Assessment review[/]"); rowsContent.Add(table); rowsContent.Add(excerpt); }); report.Show(); record CheckResult(string Check, string Target, string Status, string Detail);