Move markup to resources in dev list command.

This commit is contained in:
2025-08-18 13:46:28 +01:00
parent abf9b60ba1
commit ec7ac4ba69
2 changed files with 16 additions and 16 deletions

View File

@@ -350,14 +350,14 @@ In you are unsure, please press N to not continue.</value>
<value>No known devices attached.</value> <value>No known devices attached.</value>
</data> </data>
<data name="Path" xml:space="preserve"> <data name="Path" xml:space="preserve">
<value>Path</value> <value>[bold][olive]Path[/][/]</value>
</data> </data>
<data name="Serial" xml:space="preserve"> <data name="Serial" xml:space="preserve">
<value>Serial</value> <value>[aqua]Serial[/]</value>
<comment>From "Serial number"</comment> <comment>From "Serial number"</comment>
</data> </data>
<data name="Supported_Question" xml:space="preserve"> <data name="Supported_Question" xml:space="preserve">
<value>Supported?</value> <value>[green]Supported?[/]</value>
</data> </data>
<data name="Name_of_character_encoding_to_use" xml:space="preserve"> <data name="Name_of_character_encoding_to_use" xml:space="preserve">
<value>Name of character encoding to use.</value> <value>Name of character encoding to use.</value>

View File

@@ -38,7 +38,6 @@ using Aaru.Devices;
using Aaru.Localization; using Aaru.Localization;
using Aaru.Logging; using Aaru.Logging;
using JetBrains.Annotations; using JetBrains.Annotations;
using Serilog;
using Spectre.Console; using Spectre.Console;
using Spectre.Console.Cli; using Spectre.Console.Cli;
@@ -85,25 +84,26 @@ sealed class ListDevicesCommand : Command<ListDevicesCommand.Settings>
else else
{ {
Table table = new(); Table table = new();
table.AddColumn($"[bold][olive]{UI.Path}[/][/]"); table.AddColumn(UI.Path);
table.AddColumn($"[bold][blue]{UI.Title_Vendor}[/][/]"); table.AddColumn(UI.Title_Vendor);
table.AddColumn($"[bold][purple]{UI.Title_Model}[/][/]"); table.AddColumn(UI.Title_Model);
table.AddColumn($"[bold][aqua]{UI.Serial}[/][/]"); table.AddColumn(UI.Serial);
table.AddColumn($"[bold][rosybrown]{UI.Title_Bus}[/][/]"); table.AddColumn(UI.Title_Bus);
table.AddColumn($"[bold][green]{UI.Supported_Question}[/][/]"); table.AddColumn(UI.Supported_Question);
table.Border(TableBorder.Rounded); table.Border(TableBorder.Rounded);
table.BorderColor(Color.Yellow); table.BorderColor(Color.Yellow);
foreach(DeviceInfo dev in devices.OrderBy(d => d.Path)) foreach(DeviceInfo dev in devices.OrderBy(d => d.Path))
{ {
table.AddRow($"[italic][olive]{Markup.Escape(dev.Path ?? "")}[/][/]", table.AddRow($"[italic][olive]{Markup.Escape(dev.Path ?? "")}[/][/]",
$"[italic][blue]{Markup.Escape(dev.Vendor ?? "")}[/][/]", $"[italic][slateblue1]{Markup.Escape(dev.Vendor ?? "")}[/][/]",
$"[italic][purple]{Markup.Escape(dev.Model ?? "")}[/][/]", $"[italic][purple]{Markup.Escape(dev.Model ?? "")}[/][/]",
$"[italic][aqua]{Markup.Escape(dev.Serial ?? "")}[/][/]", $"[italic][aqua]{Markup.Escape(dev.Serial ?? "")}[/][/]",
$"[italic][rosybrown]{Markup.Escape(dev.Bus ?? "")}[/][/]", $"[italic][rosybrown]{Markup.Escape(dev.Bus ?? "")}[/][/]",
$"[italic]{(dev.Supported ? "[green][/]" : "[red][/]")}[/]"); $"[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.Path,
dev.Vendor, dev.Vendor,
dev.Model, dev.Model,