AI-Studio/app/MindWork AI Studio/Components/Settings/SettingsPanelBase.cs

32 lines
927 B
C#
Raw Normal View History

using System.Runtime.CompilerServices;
2025-01-05 14:11:15 +00:00
using AIStudio.Settings;
using AIStudio.Tools.Services;
2025-01-05 14:11:15 +00:00
using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Settings;
public abstract class SettingsPanelBase : ComponentBase
{
[CascadingParameter]
public Pages.Settings Settings { get; set; } = null!;
2025-01-05 14:11:15 +00:00
[Parameter]
public Func<IReadOnlyList<ConfigurationSelectData<string>>> AvailableLLMProvidersFunc { get; set; } = () => [];
protected abstract SettingsPanel Type { get; }
2025-01-05 14:11:15 +00:00
[Inject]
protected SettingsManager SettingsManager { get; init; } = null!;
[Inject]
protected IDialogService DialogService { get; init; } = null!;
[Inject]
protected MessageBus MessageBus { get; init; } = null!;
[Inject]
protected RustService RustService { get; init; } = null!;
protected bool IsExtended() => this.Type == this.Settings.ChosenSettingsPanel;
2025-01-05 14:11:15 +00:00
}