mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-20 16:52:57 +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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
<MudButton StartIcon="@(this.showConfigDetails ? Icons.Material.Filled.ExpandLess : Icons.Material.Filled.ExpandMore)"
|
@if (this.HasEnterpriseConfigurationDetails)
|
||||||
Size="Size.Small"
|
{
|
||||||
Variant="Variant.Text"
|
<MudButton StartIcon="@(this.showEnterpriseConfigDetails ? Icons.Material.Filled.ExpandLess : Icons.Material.Filled.ExpandMore)"
|
||||||
OnClick="@this.ToggleEnterpriseConfigDetails">
|
Size="Size.Small"
|
||||||
@(this.showConfigDetails ? T("Hide Details") : T("Show Details"))
|
Variant="Variant.Text"
|
||||||
</MudButton>
|
OnClick="@this.ToggleEnterpriseConfigDetails">
|
||||||
|
@(this.showEnterpriseConfigDetails ? T("Hide Details") : T("Show Details"))
|
||||||
|
</MudButton>
|
||||||
|
}
|
||||||
</MudListItem>
|
</MudListItem>
|
||||||
</MudList>
|
</MudList>
|
||||||
<MudStack Row="true">
|
<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 IPluginMetadata? configPlug = PluginFactory.AvailablePlugins.FirstOrDefault(x => x.Type is PluginType.CONFIGURATION);
|
||||||
|
|
||||||
private EnterpriseEnvironment currentEnvironment = EnterpriseEnvironmentService.CURRENT_ENVIRONMENT;
|
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
|
#region Overrides of ComponentBase
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user