mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-12 08:41:36 +00:00
Refactored list to use a data class instead of a tuple
This commit is contained in:
parent
62758ae1a2
commit
95c6d19c08
@ -25,12 +25,12 @@
|
|||||||
</MudText>
|
</MudText>
|
||||||
<MudCollapse Expanded="@showDatabaseDetails">
|
<MudCollapse Expanded="@showDatabaseDetails">
|
||||||
<MudText Typo="Typo.body1" Class="mt-2 mb-2">
|
<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;">
|
<div style="display: flex; align-items: center; gap: 8px;">
|
||||||
<MudIcon Icon="@Icons.Material.Filled.ArrowRightAlt"/>
|
<MudIcon Icon="@Icons.Material.Filled.ArrowRightAlt"/>
|
||||||
<span>@label: @value</span>
|
<span>@item.Label: @item.Value</span>
|
||||||
<MudCopyClipboardButton TooltipMessage="@(T("Copies the following to the clipboard")+": "+value)" StringContent=@value/>
|
<MudCopyClipboardButton TooltipMessage="@(T("Copies the following to the clipboard")+": "+item.Value)" StringContent=@item.Value/>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</MudText>
|
</MudText>
|
||||||
|
|||||||
@ -71,7 +71,9 @@ public partial class Information : MSGComponentBase
|
|||||||
|
|
||||||
private IPluginMetadata? configPlug = PluginFactory.AvailablePlugins.FirstOrDefault(x => x.Type is PluginType.CONFIGURATION);
|
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>
|
/// <summary>
|
||||||
/// Determines whether the enterprise configuration has details that can be shown/hidden.
|
/// 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.osLanguage = await this.RustService.ReadUserLanguage();
|
||||||
this.logPaths = await this.RustService.GetLogPaths();
|
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
|
// Determine the Pandoc version may take some time, so we start it here
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user