Allow the provider selection component to be disabled

This commit is contained in:
Thorsten Sommer 2026-07-03 13:59:13 +02:00
parent 7c1e023fb2
commit 791f20df15
Signed by untrusted user who does not match committer: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,6 @@
@using AIStudio.Settings
@inherits MSGComponentBase
<MudSelect T="Provider" Value="@this.ProviderSettings" ValueChanged="@this.SelectionChanged" Validation="@this.ValidateProvider" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Apps" Margin="Margin.Dense" Label="@T("Provider")" Class="mb-3 rounded-lg" OuterClass="flex-grow-0" Variant="Variant.Outlined">
<MudSelect T="Provider" Value="@this.ProviderSettings" ValueChanged="@this.SelectionChanged" Validation="@this.ValidateProvider" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Apps" Margin="Margin.Dense" Label="@T("Provider")" Class="mb-3 rounded-lg" OuterClass="flex-grow-0" Variant="Variant.Outlined" Disabled="@this.Disabled">
@foreach (var provider in this.GetAvailableProviders())
{
<MudSelectItem Value="@provider"/>

View File

@ -20,6 +20,12 @@ public partial class ProviderSelection : MSGComponentBase
[Parameter]
public Func<AIStudio.Settings.Provider, string?> ValidateProvider { get; set; } = _ => null;
/// <summary>
/// Gets or sets whether provider selection is disabled.
/// </summary>
[Parameter]
public bool Disabled { get; set; }
[Parameter]
public ConfidenceLevel ExplicitMinimumConfidence { get; set; } = ConfidenceLevel.UNKNOWN;