mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Move markup to resources in dev list command.
This commit is contained in:
@@ -350,14 +350,14 @@ In you are unsure, please press N to not continue.</value>
|
||||
<value>No known devices attached.</value>
|
||||
</data>
|
||||
<data name="Path" xml:space="preserve">
|
||||
<value>Path</value>
|
||||
<value>[bold][olive]Path[/][/]</value>
|
||||
</data>
|
||||
<data name="Serial" xml:space="preserve">
|
||||
<value>Serial</value>
|
||||
<value>[aqua]Serial[/]</value>
|
||||
<comment>From "Serial number"</comment>
|
||||
</data>
|
||||
<data name="Supported_Question" xml:space="preserve">
|
||||
<value>Supported?</value>
|
||||
<value>[green]Supported?[/]</value>
|
||||
</data>
|
||||
<data name="Name_of_character_encoding_to_use" xml:space="preserve">
|
||||
<value>Name of character encoding to use.</value>
|
||||
|
||||
@@ -38,7 +38,6 @@ using Aaru.Devices;
|
||||
using Aaru.Localization;
|
||||
using Aaru.Logging;
|
||||
using JetBrains.Annotations;
|
||||
using Serilog;
|
||||
using Spectre.Console;
|
||||
using Spectre.Console.Cli;
|
||||
|
||||
@@ -85,25 +84,26 @@ sealed class ListDevicesCommand : Command<ListDevicesCommand.Settings>
|
||||
else
|
||||
{
|
||||
Table table = new();
|
||||
table.AddColumn($"[bold][olive]{UI.Path}[/][/]");
|
||||
table.AddColumn($"[bold][blue]{UI.Title_Vendor}[/][/]");
|
||||
table.AddColumn($"[bold][purple]{UI.Title_Model}[/][/]");
|
||||
table.AddColumn($"[bold][aqua]{UI.Serial}[/][/]");
|
||||
table.AddColumn($"[bold][rosybrown]{UI.Title_Bus}[/][/]");
|
||||
table.AddColumn($"[bold][green]{UI.Supported_Question}[/][/]");
|
||||
table.AddColumn(UI.Path);
|
||||
table.AddColumn(UI.Title_Vendor);
|
||||
table.AddColumn(UI.Title_Model);
|
||||
table.AddColumn(UI.Serial);
|
||||
table.AddColumn(UI.Title_Bus);
|
||||
table.AddColumn(UI.Supported_Question);
|
||||
table.Border(TableBorder.Rounded);
|
||||
table.BorderColor(Color.Yellow);
|
||||
|
||||
foreach(DeviceInfo dev in devices.OrderBy(d => d.Path))
|
||||
{
|
||||
table.AddRow($"[italic][olive]{Markup.Escape(dev.Path ?? "")}[/][/]",
|
||||
$"[italic][blue]{Markup.Escape(dev.Vendor ?? "")}[/][/]",
|
||||
$"[italic][purple]{Markup.Escape(dev.Model ?? "")}[/][/]",
|
||||
$"[italic][aqua]{Markup.Escape(dev.Serial ?? "")}[/][/]",
|
||||
$"[italic][rosybrown]{Markup.Escape(dev.Bus ?? "")}[/][/]",
|
||||
table.AddRow($"[italic][olive]{Markup.Escape(dev.Path ?? "")}[/][/]",
|
||||
$"[italic][slateblue1]{Markup.Escape(dev.Vendor ?? "")}[/][/]",
|
||||
$"[italic][purple]{Markup.Escape(dev.Model ?? "")}[/][/]",
|
||||
$"[italic][aqua]{Markup.Escape(dev.Serial ?? "")}[/][/]",
|
||||
$"[italic][rosybrown]{Markup.Escape(dev.Bus ?? "")}[/][/]",
|
||||
$"[italic]{(dev.Supported ? "[green]✓[/]" : "[red]✗[/]")}[/]");
|
||||
|
||||
AaruLogging.Information("Path: {Path}, Vendor: {Vendor}, Model: {Model}, Serial: {Serial}, Bus: {Bus}, Supported: {Supported}",
|
||||
AaruLogging
|
||||
.Information("Path: {Path}, Vendor: {Vendor}, Model: {Model}, Serial: {Serial}, Bus: {Bus}, Supported: {Supported}",
|
||||
dev.Path,
|
||||
dev.Vendor,
|
||||
dev.Model,
|
||||
|
||||
Reference in New Issue
Block a user