mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-20 11:12:55 +00:00
Conditionally render enterprise configuration details button in the about page
This commit is contained in:
parent
98e2796604
commit
2f47cc69a7
@ -102,12 +102,15 @@
|
||||
break;
|
||||
}
|
||||
|
||||
<MudButton StartIcon="@(this.showConfigDetails ? Icons.Material.Filled.ExpandLess : Icons.Material.Filled.ExpandMore)"
|
||||
Size="Size.Small"
|
||||
Variant="Variant.Text"
|
||||
OnClick="@this.ToggleEnterpriseConfigDetails">
|
||||
@(this.showConfigDetails ? T("Hide Details") : T("Show Details"))
|
||||
</MudButton>
|
||||
@if (this.HasEnterpriseConfigurationDetails)
|
||||
{
|
||||
<MudButton StartIcon="@(this.showEnterpriseConfigDetails ? Icons.Material.Filled.ExpandLess : Icons.Material.Filled.ExpandMore)"
|
||||
Size="Size.Small"
|
||||
Variant="Variant.Text"
|
||||
OnClick="@this.ToggleEnterpriseConfigDetails">
|
||||
@(this.showEnterpriseConfigDetails ? T("Hide Details") : T("Show Details"))
|
||||
</MudButton>
|
||||
}
|
||||
</MudListItem>
|
||||
</MudList>
|
||||
<MudStack Row="true">
|
||||
|
@ -63,6 +63,31 @@ public partial class About : MSGComponentBase
|
||||
private IPluginMetadata? configPlug = PluginFactory.AvailablePlugins.FirstOrDefault(x => x.Type is PluginType.CONFIGURATION);
|
||||
|
||||
private EnterpriseEnvironment currentEnvironment = EnterpriseEnvironmentService.CURRENT_ENVIRONMENT;
|
||||
|
||||
/// <summary>
|
||||
/// 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
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.currentEnvironment.IsActive switch
|
||||
{
|
||||
// Case 1: No enterprise config and no plugin - no details available
|
||||
false when this.configPlug is null => false,
|
||||
|
||||
// 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.configPlug is null => true,
|
||||
|
||||
// Case 4: Enterprise config active with plugin - has details
|
||||
true => true
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#region Overrides of ComponentBase
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user