mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-11-14 20:20:21 +00:00
Some checks are pending
Build and Release / Read metadata (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage deb updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage deb updater) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
Co-authored-by: Thorsten Sommer <mail@tsommer.org>
60 lines
1.8 KiB
C#
60 lines
1.8 KiB
C#
using AIStudio.Dialogs.Settings;
|
|
using AIStudio.Settings;
|
|
using AIStudio.Tools.PluginSystem;
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
using DialogOptions = AIStudio.Dialogs.DialogOptions;
|
|
|
|
namespace AIStudio.Components;
|
|
|
|
public partial class ProfileSelection : MSGComponentBase
|
|
{
|
|
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(ProfileSelection).Namespace, nameof(ProfileSelection));
|
|
|
|
[Parameter]
|
|
public Profile CurrentProfile { get; set; } = Profile.NO_PROFILE;
|
|
|
|
[Parameter]
|
|
public EventCallback<Profile> CurrentProfileChanged { get; set; }
|
|
|
|
[Parameter]
|
|
public string MarginLeft { get; set; } = "ml-3";
|
|
|
|
[Parameter]
|
|
public string MarginRight { get; set; } = string.Empty;
|
|
|
|
[Parameter]
|
|
public bool Disabled { get; set; }
|
|
|
|
[Parameter]
|
|
public string DisabledText { get; set; } = string.Empty;
|
|
|
|
[Inject]
|
|
private IDialogService DialogService { get; init; } = null!;
|
|
|
|
private readonly string defaultToolTipText = TB("You can switch between your profiles here");
|
|
|
|
private string ToolTipText => this.Disabled ? this.DisabledText : this.defaultToolTipText;
|
|
|
|
private string MarginClass => $"{this.MarginLeft} {this.MarginRight}";
|
|
|
|
private string ProfileIcon(Profile profile)
|
|
{
|
|
if (profile.IsEnterpriseConfiguration)
|
|
return Icons.Material.Filled.Business;
|
|
|
|
return Icons.Material.Filled.Person4;
|
|
}
|
|
|
|
private async Task SelectionChanged(Profile profile)
|
|
{
|
|
this.CurrentProfile = profile;
|
|
await this.CurrentProfileChanged.InvokeAsync(profile);
|
|
}
|
|
|
|
private async Task OpenSettingsDialog()
|
|
{
|
|
var dialogParameters = new DialogParameters();
|
|
await this.DialogService.ShowAsync<SettingsDialogProfiles>(T("Open Profile Options"), dialogParameters, DialogOptions.FULLSCREEN);
|
|
}
|
|
} |