Updated scanner and table names.
This commit is contained in:
40
JSMR.Worker/UI/CliUi.cs
Normal file
40
JSMR.Worker/UI/CliUi.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
namespace JSMR.Worker.UI;
|
||||
|
||||
using Spectre.Console;
|
||||
|
||||
public static class CliUi
|
||||
{
|
||||
public static void PageHeader(int page, int? endPage)
|
||||
{
|
||||
AnsiConsole.MarkupLine($"[grey]Scanning page[/] [bold]{page}[/] [grey]of[/] [bold]{endPage}[/][grey]...[/]");
|
||||
}
|
||||
|
||||
public static void PageHighlights(int newUpcoming, int newRelease)
|
||||
{
|
||||
if (newUpcoming == 0 && newRelease == 0)
|
||||
return;
|
||||
|
||||
// Nice little boxed summary
|
||||
var grid = new Grid().AddColumn().AddColumn();
|
||||
|
||||
if (newUpcoming > 0)
|
||||
grid.AddRow("[yellow]Upcoming[/]", $"[yellow]{newUpcoming}[/]");
|
||||
if (newRelease > 0)
|
||||
grid.AddRow("[green]New releases[/]", $"[green]{newRelease}[/]");
|
||||
|
||||
var panel = new Panel(grid)
|
||||
.Header("[bold]Page updates[/]")
|
||||
.Border(BoxBorder.Rounded)
|
||||
.Padding(1, 0, 1, 0);
|
||||
|
||||
AnsiConsole.Write(panel);
|
||||
}
|
||||
|
||||
public static void Warning(string message) =>
|
||||
AnsiConsole.MarkupLine($"[yellow]⚠ {Escape(message)}[/]");
|
||||
|
||||
public static void Error(string message) =>
|
||||
AnsiConsole.MarkupLine($"[red]✖ {Escape(message)}[/]");
|
||||
|
||||
private static string Escape(string s) => Markup.Escape(s);
|
||||
}
|
||||
Reference in New Issue
Block a user