Move markup to resources in db stats command.

This commit is contained in:
2025-08-18 12:47:33 +01:00
parent a79723cece
commit 671d675862
2 changed files with 46 additions and 47 deletions

View File

@@ -150,58 +150,58 @@
<value>There are no statistics.</value>
</data>
<data name="Commands_statistics" xml:space="preserve">
<value>Commands statistics</value>
<value>[bold][blue]Commands statistics[/][/]</value>
</data>
<data name="Title_Command" xml:space="preserve">
<value>Command</value>
<value>[bold][purple]Command[/][/]</value>
</data>
<data name="Title_Times_used" xml:space="preserve">
<value>Times used</value>
<value>[bold][teal]Times used[/][/]</value>
</data>
<data name="Title_Filter" xml:space="preserve">
<value>Filter</value>
<value>[bold][purple]Filter[/][/]</value>
</data>
<data name="Filters_statistics" xml:space="preserve">
<value>Filters statistics</value>
<value>[bold][blue]Filters statistics[/][/]</value>
</data>
<data name="Media_image_format_statistics" xml:space="preserve">
<value>Media image format statistics</value>
<value>[bold][blue]Media image format statistics[/][/]</value>
</data>
<data name="Title_Format" xml:space="preserve">
<value>Format</value>
<value>[bold][purple]Format[/][/]</value>
</data>
<data name="Partitioning_scheme_statistics" xml:space="preserve">
<value>Partitioning scheme statistics</value>
<value>[bold][blue]Partitioning scheme statistics[/][/]</value>
</data>
<data name="Title_Scheme" xml:space="preserve">
<value>Scheme</value>
<value>[bold][purple]Scheme[/][/]</value>
</data>
<data name="Filesystem_statistics" xml:space="preserve">
<value>Filesystem statistics</value>
<value>[bold][blue]Filesystem statistics[/][/]</value>
</data>
<data name="Title_Filesystem" xml:space="preserve">
<value>Filesystem</value>
<value>[bold][purple]Filesystem[/][/]</value>
</data>
<data name="Device_statistics" xml:space="preserve">
<value>Device statistics</value>
<value>[bold][blue]Device statistics[/][/]</value>
</data>
<data name="Title_Manufacturer" xml:space="preserve">
<value>Manufacturer</value>
<value>[bold][blue]Manufacturer[/][/]</value>
</data>
<data name="Title_Model" xml:space="preserve">
<value>Model</value>
<value>[bold][purple]Model[/][/]</value>
</data>
<data name="Title_Revision" xml:space="preserve">
<value>Revision</value>
<value>[bold][teal]Revision[/][/]</value>
</data>
<data name="Title_Bus" xml:space="preserve">
<value>Bus</value>
<value>[bold][rosybrown]Bus[/][/]</value>
</data>
<data name="Media_found_in_real_device_statistics" xml:space="preserve">
<value>Media found in real device statistics</value>
<value>[bold][blue]Media found in real device statistics[/][/]</value>
</data>
<data name="Media_found_in_images_statistics" xml:space="preserve">
<value>Media found in images statistics</value>
<value>[bold][blue]Media found in images statistics[/][/]</value>
</data>
<data name="Clear_existing_main_database" xml:space="preserve">
<value>Clear existing main database.</value>

View File

@@ -36,7 +36,6 @@ using Aaru.Database;
using Aaru.Database.Models;
using Aaru.Localization;
using Aaru.Logging;
using Serilog;
using Spectre.Console;
using Spectre.Console.Cli;
using Command = Aaru.Database.Models.Command;
@@ -75,13 +74,13 @@ sealed class StatisticsCommand : Command<StatisticsCommand.Settings>
{
table = new Table
{
Title = new TableTitle($"[blue]{UI.Commands_statistics}[/]")
Title = new TableTitle(UI.Commands_statistics)
};
AaruLogging.Information(UI.Commands_statistics);
table.AddColumn(new TableColumn(new Markup($"[bold][purple]{UI.Title_Command}[/][/]").Centered()));
table.AddColumn(new TableColumn(new Markup($"[bold][teal]{UI.Title_Times_used}[/][/]").Centered()));
table.AddColumn(new TableColumn(new Markup(UI.Title_Command).Centered()));
table.AddColumn(new TableColumn(new Markup(UI.Title_Times_used).Centered()));
table.Columns[1].RightAligned();
table.Border(TableBorder.Rounded);
table.BorderColor(Color.Yellow);
@@ -138,13 +137,13 @@ sealed class StatisticsCommand : Command<StatisticsCommand.Settings>
{
table = new Table
{
Title = new TableTitle($"[blue]{UI.Filters_statistics}[/]")
Title = new TableTitle(UI.Filters_statistics)
};
AaruLogging.Information(UI.Filters_statistics);
table.AddColumn(new TableColumn(new Markup($"[bold][purple]{UI.Title_Filter}[/][/]").Centered()));
table.AddColumn(new TableColumn(new Markup($"[bold][teal]{UI.Title_Times_used}[/][/]").Centered()));
table.AddColumn(new TableColumn(new Markup(UI.Title_Filter).Centered()));
table.AddColumn(new TableColumn(new Markup(UI.Title_Times_used).Centered()));
table.Columns[1].RightAligned();
table.Border(TableBorder.Rounded);
table.BorderColor(Color.Yellow);
@@ -172,13 +171,13 @@ sealed class StatisticsCommand : Command<StatisticsCommand.Settings>
{
table = new Table
{
Title = new TableTitle($"[blue]{UI.Media_image_format_statistics}[/]")
Title = new TableTitle(UI.Media_image_format_statistics)
};
AaruLogging.Information(UI.Media_image_format_statistics);
table.AddColumn(new TableColumn(new Markup($"[bold][purple]{UI.Title_Format}[/][/]").Centered()));
table.AddColumn(new TableColumn(new Markup($"[bold][teal]{UI.Title_Times_used}[/][/]").Centered()));
table.AddColumn(new TableColumn(new Markup(UI.Title_Format).Centered()));
table.AddColumn(new TableColumn(new Markup(UI.Title_Times_used).Centered()));
table.Columns[1].RightAligned();
table.Border(TableBorder.Rounded);
table.BorderColor(Color.Yellow);
@@ -206,13 +205,13 @@ sealed class StatisticsCommand : Command<StatisticsCommand.Settings>
{
table = new Table
{
Title = new TableTitle($"[blue]{UI.Partitioning_scheme_statistics}[/]")
Title = new TableTitle(UI.Partitioning_scheme_statistics)
};
AaruLogging.Information(UI.Partitioning_scheme_statistics);
table.AddColumn(new TableColumn(new Markup($"[bold][purple]{UI.Title_Scheme}[/][/]").Centered()));
table.AddColumn(new TableColumn(new Markup($"[bold][teal]{UI.Title_Times_used}[/][/]").Centered()));
table.AddColumn(new TableColumn(new Markup(UI.Title_Scheme).Centered()));
table.AddColumn(new TableColumn(new Markup(UI.Title_Times_used).Centered()));
table.Columns[1].RightAligned();
table.Border(TableBorder.Rounded);
table.BorderColor(Color.Yellow);
@@ -240,13 +239,13 @@ sealed class StatisticsCommand : Command<StatisticsCommand.Settings>
{
table = new Table
{
Title = new TableTitle($"[blue]{UI.Filesystem_statistics}[/]")
Title = new TableTitle(UI.Filesystem_statistics)
};
AaruLogging.Information(UI.Filesystem_statistics);
table.AddColumn(new TableColumn(new Markup($"[bold][purple]{UI.Title_Filesystem}[/][/]").Centered()));
table.AddColumn(new TableColumn(new Markup($"[bold][teal]{UI.Title_Times_used}[/][/]").Centered()));
table.AddColumn(new TableColumn(new Markup(UI.Title_Filesystem).Centered()));
table.AddColumn(new TableColumn(new Markup(UI.Title_Times_used).Centered()));
table.Columns[1].RightAligned();
table.Border(TableBorder.Rounded);
table.BorderColor(Color.Yellow);
@@ -274,15 +273,15 @@ sealed class StatisticsCommand : Command<StatisticsCommand.Settings>
{
table = new Table
{
Title = new TableTitle($"[blue]{UI.Device_statistics}[/]")
Title = new TableTitle(UI.Device_statistics)
};
AaruLogging.Information(UI.Device_statistics);
table.AddColumn($"[bold][blue]{UI.Title_Manufacturer}[/][/]");
table.AddColumn($"[bold][purple]{UI.Title_Model}[/][/]");
table.AddColumn($"[bold][teal]{UI.Title_Revision}[/][/]");
table.AddColumn($"[bold][rosybrown]{UI.Title_Bus}[/][/]");
table.AddColumn(UI.Title_Manufacturer);
table.AddColumn(UI.Title_Model);
table.AddColumn(UI.Title_Revision);
table.AddColumn(UI.Title_Bus);
table.Border(TableBorder.Rounded);
table.BorderColor(Color.Yellow);
@@ -297,10 +296,10 @@ sealed class StatisticsCommand : Command<StatisticsCommand.Settings>
$"[italic][rosybrown]{Markup.Escape(ds.Bus ?? "")}[/][/]");
AaruLogging.Information("({Manufacturer}) - {Model} {Revision} ({Bus})",
ds.Manufacturer ?? "",
ds.Model ?? "",
ds.Revision ?? "",
ds.Bus ?? "");
ds.Manufacturer ?? "",
ds.Model ?? "",
ds.Revision ?? "",
ds.Bus ?? "");
}
AnsiConsole.Write(table);
@@ -312,7 +311,7 @@ sealed class StatisticsCommand : Command<StatisticsCommand.Settings>
{
table = new Table
{
Title = new TableTitle($"[blue]{UI.Media_found_in_real_device_statistics}[/]")
Title = new TableTitle(UI.Media_found_in_real_device_statistics)
};
AaruLogging.Information(UI.Media_found_in_real_device_statistics);
@@ -320,7 +319,7 @@ sealed class StatisticsCommand : Command<StatisticsCommand.Settings>
table.AddColumn(new TableColumn(new Markup($"[bold][purple]{Localization.Core.Title_Type_for_media}[/][/]")
.Centered()));
table.AddColumn(new TableColumn(new Markup($"[bold][teal]{UI.Title_Times_used}[/][/]").Centered()));
table.AddColumn(new TableColumn(new Markup(UI.Title_Times_used).Centered()));
table.Columns[1].RightAligned();
table.Border(TableBorder.Rounded);
table.BorderColor(Color.Yellow);
@@ -349,7 +348,7 @@ sealed class StatisticsCommand : Command<StatisticsCommand.Settings>
{
table = new Table
{
Title = new TableTitle($"[blue]{UI.Media_found_in_images_statistics}[/]")
Title = new TableTitle(UI.Media_found_in_images_statistics)
};
AaruLogging.Information(UI.Media_found_in_images_statistics);
@@ -357,7 +356,7 @@ sealed class StatisticsCommand : Command<StatisticsCommand.Settings>
table.AddColumn(new TableColumn(new Markup($"[bold][purple]{Localization.Core.Title_Type_for_media}[/][/]")
.Centered()));
table.AddColumn(new TableColumn(new Markup($"[bold][teal]{UI.Title_Times_used}[/][/]").Centered()));
table.AddColumn(new TableColumn(new Markup(UI.Title_Times_used).Centered()));
table.Columns[1].RightAligned();
table.Border(TableBorder.Rounded);
table.BorderColor(Color.Yellow);