Turned getter-like extension methods into extension properties (#1157)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-04 13:00:56 +01:00
1 parent 0375318b1b
commit f649febf88
286 files changed
+1379 -1109

No files matched your search

@@ -219,7 +219,7 @@
else
{
<MudAlert Severity="@this.GetAuditResultSeverity()" Variant="Variant.Filled" Dense="true">
<strong>@this.audit.Level.GetName()</strong><span>: @this.audit.Summary</span>
<strong>@this.audit.Level.Name</strong><span>: @this.audit.Summary</span>
</MudAlert>
@if (this.IsActivationBlockedBySettings)
@@ -277,7 +277,7 @@
<MudStack Spacing="1" Style="width: 100%">
<MudStack Row="true" AlignItems="AlignItems.Center" Justify="Justify.SpaceBetween">
<MudText Typo="Typo.subtitle2">@finding.Category</MudText>
<MudChip T="string" Variant="Variant.Text" Class="pt-n2" Size="Size.Small" Color="@severityUi.ChipColor">@finding.Severity.GetName()</MudChip>
<MudChip T="string" Variant="Variant.Text" Class="pt-n2" Size="Size.Small" Color="@severityUi.ChipColor">@finding.Severity.Name</MudChip>
</MudStack>
<MudText Typo="Typo.caption" Class="mt-n3 mb-3">@finding.Location</MudText>
<MudText Typo="Typo.body2" Class="mt-n2 mb-2">@finding.Description</MudText>
@@ -64,13 +64,13 @@ public partial class AssistantPluginAuditDialog : MSGComponentBase
private string ProviderLabel => this.EffectiveProvider == AIStudio.Settings.Provider.NONE
? T("No model configured")
: $"{this.EffectiveProvider.InstanceName} ({this.EffectiveProvider.UsedLLMProvider.ToName()})";
: $"{this.EffectiveProvider.InstanceName} ({this.EffectiveProvider.UsedLLMProvider.Name})";
private DataAssistantPluginAudit AuditSettings => this.SettingsManager.ConfigurationData.AssistantPluginAudit;
private AssistantAuditLevel MinimumLevel => this.SettingsManager.ConfigurationData.AssistantPluginAudit.MinimumLevel;
private string MinimumLevelLabel => this.MinimumLevel.GetName();
private string MinimumLevelLabel => this.MinimumLevel.Name;
private bool CanRunAudit => this.plugin is not null && this.EffectiveProvider != AIStudio.Settings.Provider.NONE && !this.isAuditing && !this.securityState.IsEnterpriseApproved;
@@ -200,7 +200,7 @@ public partial class AssistantPluginAuditDialog : MSGComponentBase
string.Format(
T("The assistant plugin '{0}' was audited with the level '{1}', which is below the required safety level '{2}'. Your current settings still allow activation, but this may be unsafe. Do you really want to enable this plugin?"),
this.plugin?.Name ?? T("Unknown plugin"),
this.audit?.Level.GetName() ?? T("Unknown"),
this.audit?.Level.Name ?? T("Unknown"),
this.MinimumLevelLabel)
},
};
@@ -254,7 +254,7 @@ public partial class AssistantPluginAuditDialog : MSGComponentBase
{
Text = this.GetComponentTreeItemText(component),
Caption = this.GetComponentTreeItemCaption(component, index),
Icon = component.Type.GetIcon(),
Icon = component.Type.Icon,
Expandable = children.Count > 0,
},
Children = children,
@@ -460,7 +460,7 @@ public partial class AssistantPluginAuditDialog : MSGComponentBase
private string GetComponentTreeItemText(IAssistantComponent component)
{
var type = component.Type.GetDisplayName();
var type = component.Type.DisplayName;
if (component is INamedAssistantComponent named && !string.IsNullOrWhiteSpace(named.Name))
return $"{type}: {named.Name}";
@@ -253,7 +253,7 @@
</HeaderContent>
<RowTemplate>
<MudTd>
@context.Role.ToChatTemplateName()
@context.Role.ChatTemplateName
</MudTd>
<MudTd>
@switch(context.Content)
@@ -287,7 +287,7 @@
<MudTd>
@if (this.IsReadOnly)
{
@context.Role.ToChatTemplateName()
@context.Role.ChatTemplateName
}
else
{
@@ -295,7 +295,7 @@
@foreach (var role in ChatRoles.ChatTemplateRoles())
{
<MudSelectItem Value="@role">
@role.ToChatTemplateName()
@role.ChatTemplateName
</MudSelectItem>
}
</MudSelect>
@@ -72,11 +72,11 @@
@if(this.availableAuthMethods.Count > 0 || this.dataAuthMethod != default)
{
<MudSelect @bind-Value="@this.dataAuthMethod" Text="@this.dataAuthMethod.DisplayName()" Label="Authentication Method" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.dataSourceValidation.ValidateAuthMethod">
<MudSelect @bind-Value="@this.dataAuthMethod" Text="@this.dataAuthMethod.DisplayName" Label="Authentication Method" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.dataSourceValidation.ValidateAuthMethod">
@foreach (var authMethod in this.availableAuthMethods)
{
<MudSelectItem Value="@authMethod">
@authMethod.DisplayName()
@authMethod.DisplayName
</MudSelectItem>
}
</MudSelect>
@@ -116,11 +116,11 @@
</MudSelect>
}
<MudSelect @bind-Value="@this.dataSecurityPolicy" Text="@this.dataSecurityPolicy.ToSelectionText()" Label="@T("Your security policy")" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.dataSourceValidation.ValidateSecurityPolicy">
<MudSelect @bind-Value="@this.dataSecurityPolicy" Text="@this.dataSecurityPolicy.SelectionText" Label="@T("Your security policy")" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.dataSourceValidation.ValidateSecurityPolicy">
@foreach (var policy in Enum.GetValues<DataSourceSecurity>())
{
<MudSelectItem Value="@policy">
@policy.ToSelectionText()
@policy.SelectionText
</MudSelectItem>
}
</MudSelect>
@@ -25,8 +25,8 @@
}
<TextInfoLines Label="@T("Server description")" MaxLines="14" Value="@this.serverDescription" ClipboardTooltipSubject="@T("the server description")"/>
<TextInfoLines Label="@T("Security requirements of the data provider")" MaxLines="3" Value="@this.securityRequirements.Explain()" ClipboardTooltipSubject="@T("the security requirements of the data provider")"/>
<TextInfoLines Label="@T("Your security policy")" MaxLines="3" Value="@this.DataSource.SecurityPolicy.ToInfoText()" Color="@this.DataSource.SecurityPolicy.GetColor()" ClipboardTooltipSubject="@T("your security policy")"/>
<TextInfoLines Label="@T("Security requirements of the data provider")" MaxLines="3" Value="@this.securityRequirements.Explanation" ClipboardTooltipSubject="@T("the security requirements of the data provider")"/>
<TextInfoLines Label="@T("Your security policy")" MaxLines="3" Value="@this.DataSource.SecurityPolicy.InfoText" Color="@this.DataSource.SecurityPolicy.Color" ClipboardTooltipSubject="@T("your security policy")"/>
<TextInfoLine Icon="@Icons.Material.Filled.Shield" Label="@T("Where a chat may send data after reading this data source")" Value="@this.OutboundDataRestrictionName" ClipboardTooltipSubject="@T("where a chat may send data after reading this data source")"/>
<TextInfoLine Label="@T("Maximum matches per query")" Value="@this.DataSource.MaxMatches.ToString()" ClipboardTooltipSubject="@T("the maximum number of matches per query")"/>
@@ -56,7 +56,7 @@ public partial class DataSourceERI_V1InfoDialog : MSGComponentBase, ISecretId
/// <summary>
/// The level which applies, including what the organization or the security policy demands.
/// </summary>
private string OutboundDataRestrictionName => this.DataSource.GetEffectiveOutboundDataRestriction(this.SettingsManager.ConfigurationData.DataSourceSecurity.MinimumOutboundDataRestriction).GetName();
private string OutboundDataRestrictionName => this.DataSource.GetEffectiveOutboundDataRestriction(this.SettingsManager.ConfigurationData.DataSourceSecurity.MinimumOutboundDataRestriction).Name;
private async Task<(bool Success, DataSourceERI_V1 EffectiveDataSource)> CreateEffectiveDataSource()
{
@@ -124,7 +124,7 @@
<MudText Typo="Typo.h6" Class="mb-3 mt-6">
@T("Data sharing")
</MudText>
<MudSelect @ref="@this.confidenceLevelSelect" @bind-Value="@this.dataConfidenceLevel" Text="@this.dataConfidenceLevel.GetName()" Label="@T("Required provider confidence level")" HelperText="@T("Only providers with this confidence level or higher may receive and process data from this data source.")" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.dataSourceValidation.ValidateDataSourceConfidenceLevel">
<MudSelect @ref="@this.confidenceLevelSelect" @bind-Value="@this.dataConfidenceLevel" Text="@this.dataConfidenceLevel.Name" Label="@T("Required provider confidence level")" HelperText="@T("Only providers with this confidence level or higher may receive and process data from this data source.")" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.dataSourceValidation.ValidateDataSourceConfidenceLevel">
@foreach (var level in this.ConfidenceLevels)
{
<MudSelectItem Value="@level.Value">
@@ -43,7 +43,7 @@
</MudJustifiedText>
}
<TextInfoLine Label="@T("Required provider confidence level")" Value="@this.DataSource.ConfidenceLevel.GetName()" ClipboardTooltipSubject="@T("the required provider confidence level")"/>
<TextInfoLine Label="@T("Required provider confidence level")" Value="@this.DataSource.ConfidenceLevel.Name" ClipboardTooltipSubject="@T("the required provider confidence level")"/>
<TextInfoLine Icon="@Icons.Material.Filled.Shield" Label="@T("Where a chat may send data after reading this data source")" Value="@this.OutboundDataRestrictionName" ClipboardTooltipSubject="@T("where a chat may send data after reading this data source")"/>
<TextInfoLine Label="@T("Maximum matches per query")" Value="@this.DataSource.MaxMatches.ToString()" ClipboardTooltipSubject="@T("the maximum number of matches per query")"/>
@@ -65,7 +65,7 @@ public partial class DataSourceLocalDirectoryInfoDialog : MSGComponentBase
/// <summary>
/// The level which applies, including what the organization demands.
/// </summary>
private string OutboundDataRestrictionName => this.DataSource.GetEffectiveOutboundDataRestriction(this.SettingsManager.ConfigurationData.DataSourceSecurity.MinimumOutboundDataRestriction).GetName();
private string OutboundDataRestrictionName => this.DataSource.GetEffectiveOutboundDataRestriction(this.SettingsManager.ConfigurationData.DataSourceSecurity.MinimumOutboundDataRestriction).Name;
/// <summary>
/// Takes the next file which the directory scan found.
@@ -86,7 +86,7 @@
<MudText Typo="Typo.h6" Class="mb-3 mt-6">
@T("Data sharing")
</MudText>
<MudSelect @ref="@this.confidenceLevelSelect" @bind-Value="@this.dataConfidenceLevel" Text="@this.dataConfidenceLevel.GetName()" Label="@T("Required provider confidence level")" HelperText="@T("Only providers with this confidence level or higher may receive and process data from this data source.")" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.dataSourceValidation.ValidateDataSourceConfidenceLevel">
<MudSelect @ref="@this.confidenceLevelSelect" @bind-Value="@this.dataConfidenceLevel" Text="@this.dataConfidenceLevel.Name" Label="@T("Required provider confidence level")" HelperText="@T("Only providers with this confidence level or higher may receive and process data from this data source.")" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.dataSourceValidation.ValidateDataSourceConfidenceLevel">
@foreach (var level in this.ConfidenceLevels)
{
<MudSelectItem Value="@level.Value">
@@ -37,7 +37,7 @@
</MudJustifiedText>
}
<TextInfoLine Label="@T("Required provider confidence level")" Value="@this.DataSource.ConfidenceLevel.GetName()" ClipboardTooltipSubject="@T("the required provider confidence level")"/>
<TextInfoLine Label="@T("Required provider confidence level")" Value="@this.DataSource.ConfidenceLevel.Name" ClipboardTooltipSubject="@T("the required provider confidence level")"/>
<TextInfoLine Icon="@Icons.Material.Filled.Shield" Label="@T("Where a chat may send data after reading this data source")" Value="@this.OutboundDataRestrictionName" ClipboardTooltipSubject="@T("where a chat may send data after reading this data source")"/>
<TextInfoLine Label="@T("Maximum matches per query")" Value="@this.DataSource.MaxMatches.ToString()" ClipboardTooltipSubject="@T("the maximum number of matches per query")"/>
<TextInfoLine Icon="@Icons.Material.Filled.SquareFoot" Label="@T("File size")" Value="@this.FileSize" ClipboardTooltipSubject="@T("the file size")"/>
@@ -37,7 +37,7 @@ public partial class DataSourceLocalFileInfoDialog : MSGComponentBase
/// <summary>
/// The level which applies, including what the organization demands.
/// </summary>
private string OutboundDataRestrictionName => this.DataSource.GetEffectiveOutboundDataRestriction(this.SettingsManager.ConfigurationData.DataSourceSecurity.MinimumOutboundDataRestriction).GetName();
private string OutboundDataRestrictionName => this.DataSource.GetEffectiveOutboundDataRestriction(this.SettingsManager.ConfigurationData.DataSourceSecurity.MinimumOutboundDataRestriction).Name;
private void Close() => this.MudDialog.Close();
}
@@ -27,7 +27,7 @@
{
<MudAlert Severity="Severity.Error" Variant="Variant.Outlined" Class="mb-6">
<MudJustifiedText Typo="Typo.body1">
@MailboxConnectionFailure.SERVER_NOT_ALLOWED.GetDescription()
@MailboxConnectionFailure.SERVER_NOT_ALLOWED.Description
</MudJustifiedText>
</MudAlert>
}
@@ -164,7 +164,7 @@
</MudJustifiedText>
}
<MudJustifiedText Typo="Typo.body2" Class="mb-1">
@string.Format(T("Username: {0}"), this.selectedTemplate.UsernameFormat.GetDescription())
@string.Format(T("Username: {0}"), this.selectedTemplate.UsernameFormat.Description)
</MudJustifiedText>
<MudLink Href="@this.selectedTemplate.HelpUrl" Target="_blank" Typo="Typo.body2">
@string.Format(T("Instructions of {0}"), this.selectedTemplate.Name)
@@ -214,7 +214,7 @@
Variant="Variant.Outlined"/>
</MudStack>
<MudSelect T="MailboxTransportSecurity" Value="@this.dataTransportSecurity" ValueChanged="@this.SelectTransportSecurity" Text="@this.dataTransportSecurity.GetName()" Label="@T("Encryption")" Class="mt-3" ReadOnly="@this.AllowsOnlyOrganizationMailServers" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Lock" Validation="@DataSourceValidation.ValidateMailboxTransportSecurity">
<MudSelect T="MailboxTransportSecurity" Value="@this.dataTransportSecurity" ValueChanged="@this.SelectTransportSecurity" Text="@this.dataTransportSecurity.Name" Label="@T("Encryption")" Class="mt-3" ReadOnly="@this.AllowsOnlyOrganizationMailServers" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Lock" Validation="@DataSourceValidation.ValidateMailboxTransportSecurity">
@foreach (var transportSecurity in ConfigurationSelectDataFactory.GetMailboxTransportSecurityData())
{
<MudSelectItem T="MailboxTransportSecurity" Value="@transportSecurity.Value">
@@ -301,7 +301,7 @@
<MudTextSwitch @bind-Value="@this.dataIncludeSentAndDrafts" Color="Color.Primary" Label="@T("Include sent mails and drafts?")" LabelOn="@T("Yes, also index the sent mails and the drafts")" LabelOff="@T("No, only index the selected folder and its subfolders")"/>
}
<MudSelect T="MailboxMaxAge" @bind-Value="@this.dataMaxAge" Text="@this.dataMaxAge.GetName()" Label="@T("Period")" Class="mb-1 mt-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.DateRange">
<MudSelect T="MailboxMaxAge" @bind-Value="@this.dataMaxAge" Text="@this.dataMaxAge.Name" Label="@T("Period")" Class="mb-1 mt-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.DateRange">
@foreach (var maxAge in ConfigurationSelectDataFactory.GetMailboxMaxAgeData())
{
<MudSelectItem T="MailboxMaxAge" Value="@maxAge.Value">
@@ -339,7 +339,7 @@ public partial class DataSourceMailboxDialog : MSGComponentBase
// Without a root folder, the sent mails and the drafts belong to the whole mailbox anyway:
private bool HasRootFolder => !string.IsNullOrEmpty(this.dataRootFolder);
private string ConfidenceLevelText => this.dataConfidenceLevel is ConfidenceLevel.NONE ? string.Empty : this.dataConfidenceLevel.GetName();
private string ConfidenceLevelText => this.dataConfidenceLevel is ConfidenceLevel.NONE ? string.Empty : this.dataConfidenceLevel.Name;
private OutboundDataRestriction MinimumOutboundDataRestriction => this.SettingsManager.ConfigurationData.MailboxSettings.MinimumOutboundDataRestriction;
@@ -353,7 +353,7 @@ public partial class DataSourceMailboxDialog : MSGComponentBase
if (this.testedSettings != this.CurrentSettings)
return this.RequiresConnectionTest ? T("Not tested yet.") : string.Empty;
return this.testFailure is { } failure ? failure.GetDescription() : T("Connection successful.");
return this.testFailure is { } failure ? failure.Description : T("Connection successful.");
}
}
@@ -493,7 +493,7 @@ public partial class DataSourceMailboxDialog : MSGComponentBase
// Who switches the encryption usually means the port that comes with it, unless they
// entered a port of their own:
//
if (this.dataPort == this.dataTransportSecurity.GetUsualPort() && transportSecurity.GetUsualPort() is { } usualPort)
if (this.dataPort == this.dataTransportSecurity.UsualPort && transportSecurity.UsualPort is { } usualPort)
this.dataPort = usualPort;
this.dataTransportSecurity = transportSecurity;
@@ -565,7 +565,7 @@ public partial class DataSourceMailboxDialog : MSGComponentBase
serverAnswer = e.InnerException?.Message ?? string.Empty;
this.folderIssue = e.Failure is MailboxConnectionFailure.SERVER_ERROR
? T("The server did not create the folder. Perhaps a folder of this name exists already.")
: e.Failure.GetDescription();
: e.Failure.Description;
this.Logger.LogWarning($"Creating a folder in the mailbox '{this.dataId}' failed: {e.Failure} ({e.InnerException?.GetType().Name ?? "no inner exception"}).");
return null;
@@ -577,7 +577,7 @@ public partial class DataSourceMailboxDialog : MSGComponentBase
}
catch (OperationCanceledException)
{
this.folderIssue = MailboxConnectionFailure.NETWORK_UNAVAILABLE.GetDescription();
this.folderIssue = MailboxConnectionFailure.NETWORK_UNAVAILABLE.Description;
return null;
}
finally
@@ -17,15 +17,15 @@
<MudSelect @bind-Value="@this.DataLLMProvider" Label="@T("Provider")" Class="mb-3" OpenIcon="@Icons.Material.Filled.AccountBalance" AdornmentColor="Color.Info" Adornment="Adornment.Start" Disabled="@this.IsEnterpriseConfiguration" Validation="@this.providerValidation.ValidatingProvider">
@foreach (LLMProviders provider in Enum.GetValues(typeof(LLMProviders)))
{
if (provider.ProvideEmbeddingAPI() || provider is LLMProviders.NONE)
if (provider.ProvideEmbeddingAPI || provider is LLMProviders.NONE)
{
<MudSelectItem Value="@provider">
<ProviderLabel ProviderType="@provider" CustomIconDataUrl="@(provider == this.DataLLMProvider ? this.DataCustomIconDataUrl : string.Empty)" Text="@provider.ToName()" />
<ProviderLabel ProviderType="@provider" CustomIconDataUrl="@(provider == this.DataLLMProvider ? this.DataCustomIconDataUrl : string.Empty)" Text="@provider.Name" />
</MudSelectItem>
}
}
</MudSelect>
<MudButton Disabled="@(!this.DataLLMProvider.ShowRegisterButton() || this.IsProviderProhibited)" Variant="Variant.Filled" Size="Size.Small" StartIcon="@Icons.Material.Filled.OpenInBrowser" Href="@this.DataLLMProvider.GetCreationURL()" Target="_blank">
<MudButton Disabled="@(!this.DataLLMProvider.ShowRegisterButton || this.IsProviderProhibited)" Variant="Variant.Filled" Size="Size.Small" StartIcon="@Icons.Material.Filled.OpenInBrowser" Href="@this.DataLLMProvider.CreationURL" Target="_blank">
@T("Create account")
</MudButton>
</MudStack>
@@ -43,7 +43,7 @@
<SecretInputField Secret="@this.dataAPIKey" SecretChanged="@this.OnAPIKeyChanged" Label="@this.APIKeyText" Validation="@this.providerValidation.ValidatingAPIKey"/>
}
@if (this.DataLLMProvider.IsHostnameNeeded())
@if (this.DataLLMProvider.IsHostnameNeeded)
{
<MudTextField
T="string"
@@ -58,30 +58,30 @@
UserAttributes="@SPELLCHECK_ATTRIBUTES"/>
}
@if (this.DataLLMProvider.IsHostNeeded())
@if (this.DataLLMProvider.IsHostNeeded)
{
<MudSelect T="Host" Value="@this.DataHost" ValueChanged="@this.OnHostChanged" Label="@T("Host")" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Disabled="@this.IsEnterpriseConfiguration" Validation="@this.providerValidation.ValidatingHost">
@foreach (Host host in Enum.GetValues(typeof(Host)))
{
if (host.IsEmbeddingSupported())
if (host.IsEmbeddingSupported)
{
<MudSelectItem Value="@host">
@host.Name()
@host.Name
</MudSelectItem>
}
}
</MudSelect>
}
@if (this.DataLLMProvider.IsHFInstanceProviderNeeded())
@if (this.DataLLMProvider.IsHFInstanceProviderNeeded)
{
<MudSelect T="HFInferenceProvider" Value="@this.HFInferenceProviderId" ValueChanged="@this.OnHFInferenceProviderChanged" Label="@T("Hugging Face Inference Provider")" Class="mb-3" OpenIcon="@Icons.Material.Filled.Dns" AdornmentColor="Color.Info" Adornment="Adornment.Start" Disabled="@this.IsEnterpriseConfiguration" Validation="@this.providerValidation.ValidatingHFInstanceProviderForEmbeddings">
@foreach (HFInferenceProvider inferenceProvider in Enum.GetValues(typeof(HFInferenceProvider)))
{
@if (inferenceProvider.SupportsEmbeddings())
@if (inferenceProvider.SupportsEmbeddings)
{
<MudSelectItem Value="@inferenceProvider">
@inferenceProvider.ToName()
@inferenceProvider.Name
</MudSelectItem>
}
}
@@ -285,7 +285,7 @@ public partial class EmbeddingProviderDialog : MSGComponentBase, ISecretId
// provider, the key has to be stored under the same "ENT::"-prefixed keyring row that the
// app reads from at runtime (see BaseProvider.SecretId). Otherwise, a key entered here would
// silently end up in the wrong keyring row and never be found again.
public string SecretId => this.IsEnterpriseConfiguration ? $"{ISecretId.ENTERPRISE_KEY_PREFIX}::{this.DataLLMProvider.ToSecretId()}" : this.DataLLMProvider.ToSecretId();
public string SecretId => this.IsEnterpriseConfiguration ? $"{ISecretId.ENTERPRISE_KEY_PREFIX}::{this.DataLLMProvider.SecretId}" : this.DataLLMProvider.SecretId;
public string SecretName => this.DataName;
@@ -9,7 +9,7 @@ namespace AIStudio.Dialogs;
public partial class PandocDialog : MSGComponentBase
{
// Use runtime detection instead of metadata to ensure correct RID on dev machines:
private static readonly RID CPU_ARCHITECTURE = RIDExtensions.GetCurrentRID();
private static readonly RID CPU_ARCHITECTURE = RID.Current;
[Parameter]
public bool ShowInstallationPage { get; set; }
@@ -35,7 +35,7 @@ public partial class PluginImportDialog : MSGComponentBase
_ => this.T("You are about to install a plugin from a file."),
};
private string TypeLabel => this.Preview.Plugin.Type.GetName();
private string TypeLabel => this.Preview.Plugin.Type.Name;
private string AuthorsLabel => this.Preview.Plugin.Authors.Length > 0
? string.Join(", ", this.Preview.Plugin.Authors)
@@ -26,13 +26,13 @@ public partial class PluginInfoDialog : MSGComponentBase
[Parameter]
public IAvailablePlugin Plugin { get; set; } = null!;
private string TypeText => this.Plugin.Type.GetName();
private string TypeText => this.Plugin.Type.Name;
private string AuthorsText => this.Plugin.Authors.Length > 0 ? string.Join(", ", this.Plugin.Authors) : this.T("No authors specified");
private string CategoriesText => this.Plugin.Categories.Length > 0 ? string.Join(", ", this.Plugin.Categories.Select(category => category.GetName())) : this.T("No categories specified");
private string CategoriesText => this.Plugin.Categories.Length > 0 ? string.Join(", ", this.Plugin.Categories.Select(category => category.Name)) : this.T("No categories specified");
private string TargetGroupsText => this.Plugin.TargetGroups.Length > 0 ? string.Join(", ", this.Plugin.TargetGroups.Select(targetGroup => targetGroup.Name())) : this.T("No target groups specified");
private string TargetGroupsText => this.Plugin.TargetGroups.Length > 0 ? string.Join(", ", this.Plugin.TargetGroups.Select(targetGroup => targetGroup.Name)) : this.T("No target groups specified");
/// <summary>
/// The plugin states the time in UTC; the user reads it in their own time zone.
@@ -51,7 +51,7 @@
</MudJustifiedText>
<MudJustifiedText Typo="Typo.body2">
@result.Source.Kind.GetDisplayName()
@result.Source.Kind.DisplayName
</MudJustifiedText>
</MudStack>
</MudItem>
@@ -81,7 +81,7 @@
<MudStack Spacing="0">
<MudJustifiedText Typo="Typo.body2">
<b>
@finding.Category.GetDisplayName()
@finding.Category.DisplayName
</b>
</MudJustifiedText>
@@ -23,11 +23,11 @@
@foreach (LLMProviders provider in Enum.GetValues(typeof(LLMProviders)))
{
<MudSelectItem Value="@provider">
<ProviderLabel ProviderType="@provider" CustomIconDataUrl="@(provider == this.DataLLMProvider ? this.DataCustomIconDataUrl : string.Empty)" Text="@provider.ToName()" />
<ProviderLabel ProviderType="@provider" CustomIconDataUrl="@(provider == this.DataLLMProvider ? this.DataCustomIconDataUrl : string.Empty)" Text="@provider.Name" />
</MudSelectItem>
}
</MudSelect>
<MudButton Disabled="@(!this.DataLLMProvider.ShowRegisterButton() || this.IsProviderProhibited)" Variant="Variant.Filled" Size="Size.Small" StartIcon="@Icons.Material.Filled.OpenInBrowser" Href="@this.DataLLMProvider.GetCreationURL()" Target="_blank">
<MudButton Disabled="@(!this.DataLLMProvider.ShowRegisterButton || this.IsProviderProhibited)" Variant="Variant.Filled" Size="Size.Small" StartIcon="@Icons.Material.Filled.OpenInBrowser" Href="@this.DataLLMProvider.CreationURL" Target="_blank">
@T("Create account")
</MudButton>
</MudStack>
@@ -45,7 +45,7 @@
<SecretInputField Secret="@this.dataAPIKey" SecretChanged="@this.OnAPIKeyChanged" Label="@this.APIKeyText" Validation="@this.providerValidation.ValidatingAPIKey"/>
}
@if (this.DataLLMProvider.IsHostnameNeeded())
@if (this.DataLLMProvider.IsHostnameNeeded)
{
<MudTextField
T="string"
@@ -60,30 +60,30 @@
UserAttributes="@SPELLCHECK_ATTRIBUTES"/>
}
@if (this.DataLLMProvider.IsHostNeeded())
@if (this.DataLLMProvider.IsHostNeeded)
{
<MudSelect T="Host" Value="@this.DataHost" ValueChanged="@this.OnHostChanged" Label="@T("Host")" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Disabled="@this.IsEnterpriseConfiguration" Validation="@this.providerValidation.ValidatingHost">
@foreach (Host host in Enum.GetValues(typeof(Host)))
{
@if (host.IsChatSupported())
@if (host.IsChatSupported)
{
<MudSelectItem Value="@host">
@host.Name()
@host.Name
</MudSelectItem>
}
}
</MudSelect>
}
@if (this.DataLLMProvider.IsHFInstanceProviderNeeded())
@if (this.DataLLMProvider.IsHFInstanceProviderNeeded)
{
<MudSelect T="HFInferenceProvider" Value="@this.HFInferenceProviderId" ValueChanged="@this.OnHFInferenceProviderChanged" Label="@T("Hugging Face Inference Provider")" Class="mb-3" OpenIcon="@Icons.Material.Filled.Dns" AdornmentColor="Color.Info" Adornment="Adornment.Start" Disabled="@this.IsEnterpriseConfiguration" Validation="@this.providerValidation.ValidatingHFInstanceProvider">
@foreach (HFInferenceProvider inferenceProvider in Enum.GetValues(typeof(HFInferenceProvider)))
{
@if (inferenceProvider.SupportsChat())
@if (inferenceProvider.SupportsChat)
{
<MudSelectItem Value="@inferenceProvider">
@inferenceProvider.ToName()
@inferenceProvider.Name
</MudSelectItem>
}
}
@@ -97,7 +97,7 @@
{
<MudField FullWidth="true" Label="@T("Model selection")" Variant="Variant.Outlined" Class="mb-3">
<MudStack Row="@true" AlignItems="AlignItems.Center" StretchItems="StretchItems.End">
@if (this.DataLLMProvider.IsLLMModelProvidedManually())
@if (this.DataLLMProvider.IsLLMModelProvidedManually)
{
<MudButton Variant="Variant.Filled" Size="Size.Small" StartIcon="@Icons.Material.Filled.OpenInBrowser" Href="@this.ModelsOverviewURL" Target="_blank">
@T("Show available models")
@@ -207,7 +207,7 @@ public partial class ProviderDialog : MSGComponentBase, ISecretId
GetPreviousInstanceName = () => this.dataEditingPreviousInstanceName,
GetUsedInstanceNames = () => this.UsedInstanceNames,
GetHost = () => this.DataHost,
IsModelProvidedManually = () => this.DataLLMProvider.IsLLMModelProvidedManually(),
IsModelProvidedManually = () => this.DataLLMProvider.IsLLMModelProvidedManually,
GetCustomTokenizerValidationIssue = () => this.dataCustomTokenizerValidationIssue,
IsModelSelectionHidden = () => this.IsLLMModelSelectionHidden,
};
@@ -241,7 +241,7 @@ public partial class ProviderDialog : MSGComponentBase, ISecretId
if (this.IsLLMModelSelectionHidden)
return Model.SYSTEM_MODEL;
if (this.DataLLMProvider.IsLLMModelProvidedManually())
if (this.DataLLMProvider.IsLLMModelProvidedManually)
return new Model(this.dataManuallyModel, null);
return this.DataModel;
@@ -273,7 +273,7 @@ public partial class ProviderDialog : MSGComponentBase, ISecretId
this.dataFilePath = this.DataTokenizerPath;
// When using Fireworks, we must copy the model name:
if (this.DataLLMProvider.IsLLMModelProvidedManually())
if (this.DataLLMProvider.IsLLMModelProvidedManually)
this.dataManuallyModel = this.DataModel.Id;
// When editing, we need to load the data:
@@ -334,7 +334,7 @@ public partial class ProviderDialog : MSGComponentBase, ISecretId
// provider, the key has to be stored under the same "ENT::"-prefixed keyring row that the
// app reads from at runtime (see BaseProvider.SecretId). Otherwise, a key entered here would
// silently end up in the wrong keyring row and never be found again.
public string SecretId => this.IsEnterpriseConfiguration ? $"{ISecretId.ENTERPRISE_KEY_PREFIX}::{this.DataLLMProvider.ToSecretId()}" : this.DataLLMProvider.ToSecretId();
public string SecretId => this.IsEnterpriseConfiguration ? $"{ISecretId.ENTERPRISE_KEY_PREFIX}::{this.DataLLMProvider.SecretId}" : this.DataLLMProvider.SecretId;
public string SecretName => this.DataInstanceName;
@@ -421,7 +421,7 @@ public partial class ProviderDialog : MSGComponentBase, ISecretId
private string? ValidateManuallyModel(string manuallyModel)
{
if (this.DataLLMProvider.IsLLMModelProvidedManually() && string.IsNullOrWhiteSpace(manuallyModel))
if (this.DataLLMProvider.IsLLMModelProvidedManually && string.IsNullOrWhiteSpace(manuallyModel))
return T("Please enter a model name.");
return null;
@@ -51,32 +51,32 @@ public partial class SettingsDialogBatchProcessing : SettingsDialogBase
[
.. Enum
.GetValues<BatchProcessingPromptSource>()
.Select(value => new ConfigurationSelectData<BatchProcessingPromptSource>(value.Name(), value))
.Select(value => new ConfigurationSelectData<BatchProcessingPromptSource>(value.Name, value))
];
private IReadOnlyList<ConfigurationSelectData<BatchProcessingOutputMode>> OutputModeData =>
[
.. Enum
.GetValues<BatchProcessingOutputMode>()
.Select(value => new ConfigurationSelectData<BatchProcessingOutputMode>(value.Name(), value))
.Select(value => new ConfigurationSelectData<BatchProcessingOutputMode>(value.Name, value))
];
private static IReadOnlyList<ConfigurationSelectData<FileExportFormat>> ResultFileFormatData =>
[
.. FileExportFormatExtensions.ANSWER_FORMATS
.Select(value => new ConfigurationSelectData<FileExportFormat>(value.ToName(), value))
.. FileExportFormat.AnswerFormats
.Select(value => new ConfigurationSelectData<FileExportFormat>(value.Name, value))
];
private IReadOnlyList<ConfigurationSelectData<BatchProcessingCsvSeparator>> CsvSeparatorData =>
[
.. Enum
.GetValues<BatchProcessingCsvSeparator>()
.Select(value => new ConfigurationSelectData<BatchProcessingCsvSeparator>(value.Name(), value))
.Select(value => new ConfigurationSelectData<BatchProcessingCsvSeparator>(value.Name, value))
];
private string? ValidateCustomCsvSeparator(string separator)
{
if (!BatchProcessingCsvSeparatorExtensions.IsValidCustomSeparator(separator))
if (!BatchProcessingCsvSeparator.IsValidCustomSeparator(separator))
return T("Please enter exactly one punctuation or symbol character. Letters, numbers, spaces, quotation marks, and line breaks cannot be used as CSV separators.");
return null;
@@ -59,7 +59,7 @@
{
<LayoutChoicePanels IsChosen="@(purpose => this.PreselectedLayoutOf(purpose).Length > 0)">
<ChoiceContent Context="purpose">
<ConfigurationSelect OptionDescription="@purpose.Label()" Disabled="@(() => !this.SettingsManager.ConfigurationData.SlideBuilder.PreselectOptions)" SelectedValue="@(() => this.PreselectedLayoutOf(purpose))" Data="@this.layoutOptions" SelectionUpdate="@(selectedValue => this.SetPreselectedLayout(purpose, selectedValue))" OptionHelp="@purpose.Help()" IsLocked="() => ManagedConfiguration.TryGet(x => x.SlideBuilder, x => x.PreselectedLayouts, out var meta) && meta.IsLocked"/>
<ConfigurationSelect OptionDescription="@purpose.Label" Disabled="@(() => !this.SettingsManager.ConfigurationData.SlideBuilder.PreselectOptions)" SelectedValue="@(() => this.PreselectedLayoutOf(purpose))" Data="@this.layoutOptions" SelectionUpdate="@(selectedValue => this.SetPreselectedLayout(purpose, selectedValue))" OptionHelp="@purpose.Help" IsLocked="() => ManagedConfiguration.TryGet(x => x.SlideBuilder, x => x.PreselectedLayouts, out var meta) && meta.IsLocked"/>
</ChoiceContent>
</LayoutChoicePanels>
}
@@ -83,7 +83,7 @@
{
@foreach (var templateSlide in loadedTemplate.Slides)
{
<ConfigurationSelect OptionDescription="@templateSlide.Label()" Disabled="@(() => !this.SettingsManager.ConfigurationData.SlideBuilder.PreselectOptions)" SelectedValue="@(() => this.PreselectedUseOf(templateSlide))" Data="@UseOptionsOf(templateSlide)" SelectionUpdate="@(selectedValue => this.SetPreselectedUse(templateSlide.Number, selectedValue))" IsLocked="@AreTemplateSlideUsesLocked"/>
<ConfigurationSelect OptionDescription="@templateSlide.Label" Disabled="@(() => !this.SettingsManager.ConfigurationData.SlideBuilder.PreselectOptions)" SelectedValue="@(() => this.PreselectedUseOf(templateSlide))" Data="@UseOptionsOf(templateSlide)" SelectionUpdate="@(selectedValue => this.SetPreselectedUse(templateSlide.Number, selectedValue))" IsLocked="@AreTemplateSlideUsesLocked"/>
}
}
@@ -112,7 +112,7 @@ public partial class SettingsDialogSlideBuilder : SettingsDialogBase
/// </summary>
private static List<ConfigurationSelectData<TemplateSlideUse>> UseOptionsOf(TemplateSlide slide) => Enum.GetValues<TemplateSlideUse>()
.Where(use => use is not TemplateSlideUse.EDIT || slide.IsEditable)
.Select(use => new ConfigurationSelectData<TemplateSlideUse>(use.Name(), use))
.Select(use => new ConfigurationSelectData<TemplateSlideUse>(use.Name, use))
.ToList();
/// <summary>
@@ -147,7 +147,7 @@ public partial class ToolSettingsExportDialog : SettingsDialogBase
private string GetMinimumProviderConfidenceName()
{
var confidence = this.item is null ? ConfidenceLevel.NONE : this.ToolRegistry.GetMinimumProviderConfidence(this.item.Id);
return confidence is ConfidenceLevel.NONE ? T("No minimum confidence level chosen") : confidence.GetName();
return confidence is ConfidenceLevel.NONE ? T("No minimum confidence level chosen") : confidence.Name;
}
private async Task Export()
@@ -17,15 +17,15 @@
<MudSelect @bind-Value="@this.DataLLMProvider" Label="@T("Provider")" Class="mb-3" Disabled="@this.IsEnterpriseConfiguration" Validation="@this.providerValidation.ValidatingProvider">
@foreach (LLMProviders provider in Enum.GetValues(typeof(LLMProviders)))
{
if (provider.ProvideTranscriptionAPI() || provider is LLMProviders.NONE)
if (provider.ProvideTranscriptionAPI || provider is LLMProviders.NONE)
{
<MudSelectItem Value="@provider">
<ProviderLabel ProviderType="@provider" CustomIconDataUrl="@(provider == this.DataLLMProvider ? this.DataCustomIconDataUrl : string.Empty)" Text="@provider.ToName()" />
<ProviderLabel ProviderType="@provider" CustomIconDataUrl="@(provider == this.DataLLMProvider ? this.DataCustomIconDataUrl : string.Empty)" Text="@provider.Name" />
</MudSelectItem>
}
}
</MudSelect>
<MudButton Disabled="@(!this.DataLLMProvider.ShowRegisterButton() || this.IsProviderProhibited)" Variant="Variant.Filled" Size="Size.Small" StartIcon="@Icons.Material.Filled.OpenInBrowser" Href="@this.DataLLMProvider.GetCreationURL()" Target="_blank">
<MudButton Disabled="@(!this.DataLLMProvider.ShowRegisterButton || this.IsProviderProhibited)" Variant="Variant.Filled" Size="Size.Small" StartIcon="@Icons.Material.Filled.OpenInBrowser" Href="@this.DataLLMProvider.CreationURL" Target="_blank">
@T("Create account")
</MudButton>
</MudStack>
@@ -43,7 +43,7 @@
<SecretInputField Secret="@this.dataAPIKey" SecretChanged="@this.OnAPIKeyChanged" Label="@this.APIKeyText" Validation="@this.providerValidation.ValidatingAPIKey"/>
}
@if (this.DataLLMProvider.IsHostnameNeeded())
@if (this.DataLLMProvider.IsHostnameNeeded)
{
<MudTextField
T="string"
@@ -58,30 +58,30 @@
UserAttributes="@SPELLCHECK_ATTRIBUTES"/>
}
@if (this.DataLLMProvider.IsHostNeeded())
@if (this.DataLLMProvider.IsHostNeeded)
{
<MudSelect T="Host" Value="@this.DataHost" ValueChanged="@this.OnHostChanged" Label="@T("Host")" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Disabled="@this.IsEnterpriseConfiguration" Validation="@this.providerValidation.ValidatingHost">
@foreach (Host host in Enum.GetValues(typeof(Host)))
{
if (host.IsTranscriptionSupported())
if (host.IsTranscriptionSupported)
{
<MudSelectItem Value="@host">
@host.Name()
@host.Name
</MudSelectItem>
}
}
</MudSelect>
}
@if (this.DataLLMProvider.IsHFInstanceProviderNeeded())
@if (this.DataLLMProvider.IsHFInstanceProviderNeeded)
{
<MudSelect T="HFInferenceProvider" Value="@this.HFInferenceProviderId" ValueChanged="@this.OnHFInferenceProviderChanged" Label="@T("Hugging Face Inference Provider")" Class="mb-3" OpenIcon="@Icons.Material.Filled.Dns" AdornmentColor="Color.Info" Adornment="Adornment.Start" Disabled="@this.IsEnterpriseConfiguration" Validation="@this.providerValidation.ValidatingHFInstanceProviderForTranscription">
@foreach (HFInferenceProvider inferenceProvider in Enum.GetValues(typeof(HFInferenceProvider)))
{
@if (inferenceProvider.SupportsTranscription())
@if (inferenceProvider.SupportsTranscription)
{
<MudSelectItem Value="@inferenceProvider">
@inferenceProvider.ToName()
@inferenceProvider.Name
</MudSelectItem>
}
}
@@ -240,7 +240,7 @@ public partial class TranscriptionProviderDialog : MSGComponentBase, ISecretId
// provider, the key has to be stored under the same "ENT::"-prefixed keyring row that the
// app reads from at runtime (see BaseProvider.SecretId). Otherwise, a key entered here would
// silently end up in the wrong keyring row and never be found again.
public string SecretId => this.IsEnterpriseConfiguration ? $"{ISecretId.ENTERPRISE_KEY_PREFIX}::{this.DataLLMProvider.ToSecretId()}" : this.DataLLMProvider.ToSecretId();
public string SecretId => this.IsEnterpriseConfiguration ? $"{ISecretId.ENTERPRISE_KEY_PREFIX}::{this.DataLLMProvider.SecretId}" : this.DataLLMProvider.SecretId;
public string SecretName => this.DataName;