Refactored list to use a data class instead of a tuple

This commit is contained in:
Thorsten Sommer 2026-02-02 13:11:22 +01:00
parent 62758ae1a2
commit 95c6d19c08
Signed by untrusted user who does not match committer: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 8 additions and 6 deletions

View File

@ -25,12 +25,12 @@
</MudText>
<MudCollapse Expanded="@showDatabaseDetails">
<MudText Typo="Typo.body1" Class="mt-2 mb-2">
@foreach (var (label, value) in DatabaseDisplayInfo)
@foreach (var item in this.databaseDisplayInfo)
{
<div style="display: flex; align-items: center; gap: 8px;">
<MudIcon Icon="@Icons.Material.Filled.ArrowRightAlt"/>
<span>@label: @value</span>
<MudCopyClipboardButton TooltipMessage="@(T("Copies the following to the clipboard")+": "+value)" StringContent=@value/>
<span>@item.Label: @item.Value</span>
<MudCopyClipboardButton TooltipMessage="@(T("Copies the following to the clipboard")+": "+item.Value)" StringContent=@item.Value/>
</div>
}
</MudText>

View File

@ -71,7 +71,9 @@ public partial class Information : MSGComponentBase
private IPluginMetadata? configPlug = PluginFactory.AvailablePlugins.FirstOrDefault(x => x.Type is PluginType.CONFIGURATION);
private List<(string Label, string Value)> DatabaseDisplayInfo = new();
private sealed record DatabaseDisplayInfo(string Label, string Value);
private readonly List<DatabaseDisplayInfo> databaseDisplayInfo = new();
/// <summary>
/// Determines whether the enterprise configuration has details that can be shown/hidden.
@ -107,9 +109,9 @@ public partial class Information : MSGComponentBase
this.osLanguage = await this.RustService.ReadUserLanguage();
this.logPaths = await this.RustService.GetLogPaths();
await foreach (var item in this.DatabaseClient.GetDisplayInfo())
await foreach (var (label, value) in this.DatabaseClient.GetDisplayInfo())
{
this.DatabaseDisplayInfo.Add(item);
this.databaseDisplayInfo.Add(new DatabaseDisplayInfo(label, value));
}
// Determine the Pandoc version may take some time, so we start it here