From 739bdb106864d06b987ed0eb96e523adbfcc06bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peer=20Sch=C3=BCtt?= <20603780+peerschuett@users.noreply.github.com> Date: Thu, 24 Jul 2025 14:04:12 +0200 Subject: [PATCH] Initial version works, but needs a lot of refinement --- app/MindWork AI Studio/Pages/About.razor | 59 ++++++++++++++++++++- app/MindWork AI Studio/Pages/About.razor.cs | 22 ++++++++ 2 files changed, 79 insertions(+), 2 deletions(-) diff --git a/app/MindWork AI Studio/Pages/About.razor b/app/MindWork AI Studio/Pages/About.razor index 04b43128..fee1a535 100644 --- a/app/MindWork AI Studio/Pages/About.razor +++ b/app/MindWork AI Studio/Pages/About.razor @@ -1,4 +1,6 @@ @attribute [Route(Routes.ABOUT)] +@using AIStudio.Tools.PluginSystem +@using AIStudio.Tools.Services @inherits MSGComponentBase
@@ -23,7 +25,60 @@ - + + @{ + var configPlug = PluginFactory.AvailablePlugins.FirstOrDefault(x => x.Type is PluginType.CONFIGURATION); + var currentEnvironment = EnterpriseEnvironmentService.CURRENT_ENVIRONMENT; + } + + @if (!currentEnvironment.IsActive && configPlug is null) + { + @T("AI Studio runs without an enterprise configuration.") + } + else if (!currentEnvironment.IsActive) + { + @T("AI Studio runs with an enterprise configuration using the configuration plugin.") + + Plugin ID: @configPlug!.Id + + } + else if (currentEnvironment.IsActive && configPlug is null) + { + @T("AI Studio runs with an enterprise configuration. The configuration plugin is not yet available.") + + Config ID: @currentEnvironment.ConfigurationId + Server URL: @currentEnvironment.ConfigurationServerUrl + + } + else if (currentEnvironment.IsActive) + { + @T("AI Studio runs with an enterprise configuration. The configuration plugin is active.") + +
+ Config ID: @currentEnvironment.ConfigurationId + +
+
+ Server URL: @currentEnvironment.ConfigurationServerUrl + +
+
+ } + + + @(showConfigDetails ? "Hide Details" : "Show Details") + +
@@ -48,7 +103,7 @@
@T("View our project roadmap and help shape AI Studio's future development.") - +
@T("Did you find a bug or are you experiencing issues? Report your concern here.") diff --git a/app/MindWork AI Studio/Pages/About.razor.cs b/app/MindWork AI Studio/Pages/About.razor.cs index 8c4fe923..38526e8f 100644 --- a/app/MindWork AI Studio/Pages/About.razor.cs +++ b/app/MindWork AI Studio/Pages/About.razor.cs @@ -120,6 +120,28 @@ public partial class About : MSGComponentBase await this.DeterminePandocVersion(); } + private bool showConfigDetails = false; + + private void ToggleConfigDetails() + { + this.showConfigDetails = !this.showConfigDetails; + } + + [Inject] private IJSRuntime JSRuntime { get; set; } = default!; + + private async Task CopyToClipboard(string text) + { + try + { + await this.JSRuntime.InvokeVoidAsync("navigator.clipboard.writeText", text); + this.Snackbar.Add("Copied to clipboard!", Severity.Success); + } + catch (Exception) + { + this.Snackbar.Add("Failed to copy to clipboard", Severity.Error); + } + } + private string GetEnterpriseEnvironment() { var configPlug = PluginFactory.AvailablePlugins.FirstOrDefault(x => x.Type is PluginType.CONFIGURATION);