From c320d05f8f3de774dcdb335ce2ccdc0d07469335 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sun, 1 Jun 2025 20:50:34 +0200 Subject: [PATCH] Add enterprise environment details to About page --- app/MindWork AI Studio/Pages/About.razor | 4 +++- app/MindWork AI Studio/Pages/About.razor.cs | 24 ++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/app/MindWork AI Studio/Pages/About.razor b/app/MindWork AI Studio/Pages/About.razor index ff764e0c..b063672f 100644 --- a/app/MindWork AI Studio/Pages/About.razor +++ b/app/MindWork AI Studio/Pages/About.razor @@ -23,6 +23,7 @@ + @@ -106,7 +107,7 @@ - + @@ -116,6 +117,7 @@ + diff --git a/app/MindWork AI Studio/Pages/About.razor.cs b/app/MindWork AI Studio/Pages/About.razor.cs index 7a65d05f..d159ab53 100644 --- a/app/MindWork AI Studio/Pages/About.razor.cs +++ b/app/MindWork AI Studio/Pages/About.razor.cs @@ -3,6 +3,7 @@ using System.Reflection; using AIStudio.Components; using AIStudio.Dialogs; using AIStudio.Tools.Metadata; +using AIStudio.Tools.PluginSystem; using AIStudio.Tools.Rust; using AIStudio.Tools.Services; @@ -30,7 +31,7 @@ public partial class About : MSGComponentBase private static readonly MetaDataArchitectureAttribute META_DATA_ARCH = ASSEMBLY.GetCustomAttribute()!; private static readonly MetaDataLibrariesAttribute META_DATA_LIBRARIES = ASSEMBLY.GetCustomAttribute()!; - private static string TB(string fallbackEN) => Tools.PluginSystem.I18N.I.T(fallbackEN, typeof(About).Namespace, nameof(About)); + private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(About).Namespace, nameof(About)); private string osLanguage = string.Empty; @@ -116,6 +117,27 @@ public partial class About : MSGComponentBase await this.DeterminePandocVersion(); } + private string GetEnterpriseEnvironment() + { + var configPlug = PluginFactory.AvailablePlugins.FirstOrDefault(x => x.Type is PluginType.CONFIGURATION); + var currentEnvironment = EnterpriseEnvironmentService.CURRENT_ENVIRONMENT; + + switch (currentEnvironment) + { + case { IsActive: false } when configPlug is null: + return T("AI Studio runs without an enterprise configuration."); + + case { IsActive: false }: + return string.Format(T("AI Studio runs with an enterprise configuration using the configuration plugin '{0}', without central configuration management."), configPlug.Id); + + case { IsActive: true } when configPlug is null: + return string.Format(T("AI Studio runs with an enterprise configuration id '{0}' and configuration server URL '{1}'. The configuration plugin is not yet available."), currentEnvironment.ConfigurationId, currentEnvironment.ConfigurationServerUrl); + + case { IsActive: true }: + return string.Format(T("AI Studio runs with an enterprise configuration id '{0}' and configuration server URL '{1}'. The configuration plugin is active."), currentEnvironment.ConfigurationId, currentEnvironment.ConfigurationServerUrl); + } + } + private async Task CopyStartupLogPath() { await this.RustService.CopyText2Clipboard(this.Snackbar, this.logPaths.LogStartupPath);