mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 21:27:21 +00:00
Turned getter-like extension methods into extension properties (#1157)
This commit is contained in:
1 parent
0375318b1b
commit
f649febf88
286 files changed
+1379
-1109
No files matched your search
@@ -65,7 +65,7 @@
|
||||
<AssistantBlock TSettings="SettingsDialogLegalCheck" Component="Components.LEGAL_CHECK_ASSISTANT" Name="@T("Legal Check")" Description="@T("Ask a question about a legal document.")" Icon="@Icons.Material.Filled.Gavel" Link="@Routes.ASSISTANT_LEGAL_CHECK"/>
|
||||
<AssistantBlock TSettings="SettingsDialogIconFinder" Component="Components.ICON_FINDER_ASSISTANT" Name="@T("Icon Finder")" Description="@T("Use an LLM to find an icon for a given context.")" Icon="@Icons.Material.Filled.FindInPage" Link="@Routes.ASSISTANT_ICON_FINDER"/>
|
||||
<AssistantBlock TSettings="SettingsDialogSlideBuilder" Component="Components.SLIDE_BUILDER_ASSISTANT" Name="@T("Slide Assistant")" Description="@T("Turn texts and documents into slides, also as a PowerPoint file in the design of your template.")" Icon="@Icons.Material.Filled.Slideshow" Link="@Routes.ASSISTANT_SLIDE_BUILDER"/>
|
||||
<AssistantBlock TSettings="SettingsDialogVisualBriefing" Component="Components.VISUAL_BRIEFING_ASSISTANT" RequiredPreviewFeature="Components.VISUAL_BRIEFING_ASSISTANT.RequiredPreviewFeature()" Name="@T("Visual Briefing Assistant")" Description="@T("Turn documents, data, images, audio, and video into an audience-ready interactive briefing.")" Icon="@Icons.Material.Filled.DashboardCustomize" Link="@Routes.ASSISTANT_VISUAL_BRIEFING" />
|
||||
<AssistantBlock TSettings="SettingsDialogVisualBriefing" Component="Components.VISUAL_BRIEFING_ASSISTANT" RequiredPreviewFeature="Components.VISUAL_BRIEFING_ASSISTANT.RequiredPreviewFeature" Name="@T("Visual Briefing Assistant")" Description="@T("Turn documents, data, images, audio, and video into an audience-ready interactive briefing.")" Icon="@Icons.Material.Filled.DashboardCustomize" Link="@Routes.ASSISTANT_VISUAL_BRIEFING" />
|
||||
</AssistantCategoryBlock>
|
||||
|
||||
<AssistantCategoryBlock Title="@T("Learning")">
|
||||
|
||||
@@ -321,15 +321,15 @@ public partial class Embeddings : MSGComponentBase
|
||||
//
|
||||
if (failure.FailureReason is not ProviderRequestFailureReason.NONE)
|
||||
{
|
||||
var isFixedInSettings = failure.FailureReason.IsFixedInProviderSettings();
|
||||
return new FailureCause(isFixedInSettings ? 0 : 1, failure.FailureReason.GetName(), isFixedInSettings ? Icons.Material.Filled.Key : Icons.Material.Filled.CloudOff, Color.Error, false, isFixedInSettings, true);
|
||||
var isFixedInSettings = failure.FailureReason.IsFixedInProviderSettings;
|
||||
return new FailureCause(isFixedInSettings ? 0 : 1, failure.FailureReason.Name, isFixedInSettings ? Icons.Material.Filled.Key : Icons.Material.Filled.CloudOff, Color.Error, false, isFixedInSettings, true);
|
||||
}
|
||||
|
||||
//
|
||||
// Codes without a name of their own carry everything they know in the message of the
|
||||
// single file, which is why those groups show that message per file:
|
||||
//
|
||||
var causeName = failure.ExtractionCode.GetIndexingCauseName();
|
||||
var causeName = failure.ExtractionCode.IndexingCauseName;
|
||||
var hasCauseName = !string.IsNullOrWhiteSpace(causeName);
|
||||
var title = hasCauseName ? causeName : T("Other cause");
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ public partial class Home : MSGComponentBase
|
||||
return;
|
||||
|
||||
this.SettingsManager.StartupStartPageRedirectHandled = true;
|
||||
var startPageRoute = this.SettingsManager.ConfigurationData.App.StartPage.ToRoute();
|
||||
var startPageRoute = this.SettingsManager.ConfigurationData.App.StartPage.Route;
|
||||
if (string.IsNullOrWhiteSpace(startPageRoute))
|
||||
return;
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public partial class Information : MSGComponentBase
|
||||
private string osUserName = string.Empty;
|
||||
private UpdatePolicyMode updatePolicyMode;
|
||||
|
||||
private static string VersionApp => $"MindWork AI Studio: v{META_DATA.Version} (commit {META_DATA.AppCommitHash}, build {META_DATA.BuildNum}, {META_DATA_ARCH.Architecture.ToRID().ToUserFriendlyName()})";
|
||||
private static string VersionApp => $"MindWork AI Studio: v{META_DATA.Version} (commit {META_DATA.AppCommitHash}, build {META_DATA.BuildNum}, {META_DATA_ARCH.Architecture.ToRID().UserFriendlyName})";
|
||||
|
||||
private static string MudBlazorVersion => $"MudBlazor: v{META_DATA.MudBlazorVersion}";
|
||||
|
||||
@@ -203,26 +203,20 @@ public partial class Information : MSGComponentBase
|
||||
/// Determines whether the enterprise configuration has details that can be shown/hidden.
|
||||
/// Returns true if there are details available, false otherwise.
|
||||
/// </summary>
|
||||
private bool HasEnterpriseConfigurationDetails
|
||||
private bool HasEnterpriseConfigurationDetails => this.HasAnyActiveEnvironment switch
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.HasAnyActiveEnvironment switch
|
||||
{
|
||||
// Case 1: No enterprise config and no plugin - no details available
|
||||
false when this.configPlugins.Count == 0 => false,
|
||||
// Case 1: No enterprise config and no plugin - no details available
|
||||
false when this.configPlugins.Count == 0 => false,
|
||||
|
||||
// Case 2: Enterprise config with plugin but no central management - has details
|
||||
false => true,
|
||||
// Case 2: Enterprise config with plugin but no central management - has details
|
||||
false => true,
|
||||
|
||||
// Case 3: Enterprise config active but no plugin - has details
|
||||
true when this.configPlugins.Count == 0 => true,
|
||||
// Case 3: Enterprise config active but no plugin - has details
|
||||
true when this.configPlugins.Count == 0 => true,
|
||||
|
||||
// Case 4: Enterprise config active with plugin - has details
|
||||
true => true
|
||||
};
|
||||
}
|
||||
}
|
||||
// Case 4: Enterprise config active with plugin - has details
|
||||
true => true
|
||||
};
|
||||
|
||||
#region Overrides of ComponentBase
|
||||
|
||||
@@ -321,19 +315,13 @@ public partial class Information : MSGComponentBase
|
||||
await this.InvokeAsync(this.StateHasChanged);
|
||||
}
|
||||
|
||||
private string PandocButtonText
|
||||
private string PandocButtonText => this.pandocInstallation switch
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.pandocInstallation switch
|
||||
{
|
||||
{ IsAvailable: true, CheckWasSuccessful: true } => this.T("Check Pandoc Installation"),
|
||||
{ IsAvailable: false, CheckWasSuccessful: true } => this.T("Update Pandoc"),
|
||||
|
||||
_ => this.T("Install Pandoc")
|
||||
};
|
||||
}
|
||||
}
|
||||
{ IsAvailable: true, CheckWasSuccessful: true } => this.T("Check Pandoc Installation"),
|
||||
{ IsAvailable: false, CheckWasSuccessful: true } => this.T("Update Pandoc"),
|
||||
|
||||
_ => this.T("Install Pandoc")
|
||||
};
|
||||
|
||||
private async Task ShowPandocDialog()
|
||||
{
|
||||
|
||||
@@ -123,7 +123,7 @@ public partial class Plugins : MSGComponentBase
|
||||
{
|
||||
var blockedAudit = securityState.Audit;
|
||||
if (blockedAudit is not null)
|
||||
await this.DialogService.ShowMessageBoxAsync(this.T("Assistant Audit"), $"{blockedAudit.Level.GetName()}: {blockedAudit.Summary}", this.T("Close"));
|
||||
await this.DialogService.ShowMessageBoxAsync(this.T("Assistant Audit"), $"{blockedAudit.Level.Name}: {blockedAudit.Summary}", this.T("Close"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -168,8 +168,8 @@ public partial class Plugins : MSGComponentBase
|
||||
string.Format(
|
||||
this.T("The assistant plugin '{0}' was audited with the level '{1}', which is below the required minimum level '{2}'. Your current settings allow activation anyway, but this may be potentially dangerous. Do you really want to enable this plugin?"),
|
||||
pluginName,
|
||||
actualLevel.GetName(),
|
||||
this.AssistantPluginAuditSettings.MinimumLevel.GetName())
|
||||
actualLevel.Name,
|
||||
this.AssistantPluginAuditSettings.MinimumLevel.Name)
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user