Files
AI-Studio/app/MindWork AI Studio/Components/ProfileSelection.razor
T

34 lines
2.1 KiB
Plaintext
Raw Normal View History

2025-05-25 13:27:22 +02:00
@using AIStudio.Settings
2025-04-27 09:06:05 +02:00
@inherits MSGComponentBase
2025-05-24 12:27:00 +02:00
<MudTooltip Text="@this.ToolTipText" Placement="Placement.Top">
2026-09-07 16:09:00 +02:00
<MudMenu TransformOrigin="@Origin.BottomLeft" AnchorOrigin="Origin.TopLeft" StartIcon="@Icons.Material.Filled.Person4" EndIcon="@Icons.Material.Filled.KeyboardArrowDown" Label="@this.SelectionLabel" Variant="Variant.Filled" Color="Color.Default" Class="@this.MarginClass" Disabled="@this.Disabled">
2025-05-25 13:27:22 +02:00
<ActivatorContent>
2026-09-07 16:09:00 +02:00
@if (this.SelectedProfiles.Count > 0)
2025-05-25 13:27:22 +02:00
{
<MudButton IconSize="Size.Large" StartIcon="@Icons.Material.Filled.Person4" IconColor="Color.Default">
2026-09-07 16:09:00 +02:00
@this.SelectionLabel
2025-05-25 13:27:22 +02:00
</MudButton>
}
else
{
2026-03-14 12:40:40 +01:00
<MudIconButton Icon="@Icons.Material.Filled.Person4" Color="Color.Default" />
2025-05-25 13:27:22 +02:00
}
</ActivatorContent>
<ChildContent>
2026-01-09 09:52:31 +01:00
<MudMenuItem Icon="@Icons.Material.Filled.Settings" Label="@T("Manage your profiles")" OnClick="@(async () => await this.OpenSettingsDialog())" />
2025-05-25 13:27:22 +02:00
<MudDivider/>
2026-09-07 16:09:00 +02:00
<MudMenuItem Icon="@Icons.Material.Filled.PersonOff" AutoClose="false" Disabled="@(this.SelectedProfiles.Count == 0)" OnClick="@this.ClearSelection">
@T("Clear all")
</MudMenuItem>
@foreach (var profile in this.SettingsManager.ConfigurationData.Profiles)
2025-05-25 13:27:22 +02:00
{
2026-09-07 16:09:00 +02:00
<MudMenuItem Icon="@(this.SelectedProfileIds.Contains(profile.Id) ? Icons.Material.Filled.CheckBox : Icons.Material.Filled.CheckBoxOutlineBlank)" IconColor="Color.Primary" AutoClose="false" Class="mud-list-item-dense" OnClick="@(() => this.SelectionChanged(profile, !this.SelectedProfileIds.Contains(profile.Id)))">
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="1">
<MudIcon Icon="@this.ProfileIcon(profile)" Size="Size.Small" Style="color: var(--mud-palette-action-default);" />
<MudText Typo="Typo.body1">@profile.GetSafeName()</MudText>
</MudStack>
2025-05-25 13:27:22 +02:00
</MudMenuItem>
}
</ChildContent>
2024-09-08 21:01:51 +02:00
</MudMenu>
2026-03-14 12:40:40 +01:00
</MudTooltip>