diff --git a/app/MindWork AI Studio/Layout/MainLayout.razor.cs b/app/MindWork AI Studio/Layout/MainLayout.razor.cs index d95b8d6f..b2691b74 100644 --- a/app/MindWork AI Studio/Layout/MainLayout.razor.cs +++ b/app/MindWork AI Studio/Layout/MainLayout.razor.cs @@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Routing; using DialogOptions = AIStudio.Dialogs.DialogOptions; +using EnterpriseEnvironment = AIStudio.Tools.EnterpriseEnvironment; namespace AIStudio.Layout; @@ -204,7 +205,14 @@ public partial class MainLayout : LayoutComponentBase, IMessageBusReceiver, ILan // Ensure that all internal plugins are present: await PluginFactory.EnsureInternalPlugins(); - // Load (but not start) all plugins, without waiting for them: + // + // Check if there is an enterprise configuration plugin to download: + // + var enterpriseEnvironment = this.MessageBus.CheckDeferredMessages(Event.STARTUP_ENTERPRISE_ENVIRONMENT).FirstOrDefault(); + if(enterpriseEnvironment != default) + await PluginFactory.TryDownloadingConfigPluginAsync(enterpriseEnvironment.ConfigurationId, enterpriseEnvironment.ConfigurationServerUrl); + + // Load (but not start) all plugins without waiting for them: var pluginLoadingTimeout = new CancellationTokenSource(TimeSpan.FromSeconds(5)); await PluginFactory.LoadAll(pluginLoadingTimeout.Token); diff --git a/app/MindWork AI Studio/Tools/Event.cs b/app/MindWork AI Studio/Tools/Event.cs index 9741868d..fc8ca8e3 100644 --- a/app/MindWork AI Studio/Tools/Event.cs +++ b/app/MindWork AI Studio/Tools/Event.cs @@ -9,6 +9,7 @@ public enum Event CONFIGURATION_CHANGED, COLOR_THEME_CHANGED, STARTUP_PLUGIN_SYSTEM, + STARTUP_ENTERPRISE_ENVIRONMENT, PLUGINS_RELOADED, SHOW_ERROR, SHOW_WARNING, diff --git a/app/MindWork AI Studio/Tools/Services/EnterpriseEnvironmentService.cs b/app/MindWork AI Studio/Tools/Services/EnterpriseEnvironmentService.cs index 28ec16de..bde1e977 100644 --- a/app/MindWork AI Studio/Tools/Services/EnterpriseEnvironmentService.cs +++ b/app/MindWork AI Studio/Tools/Services/EnterpriseEnvironmentService.cs @@ -14,7 +14,7 @@ public sealed class EnterpriseEnvironmentService(ILogger