mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-03-29 11:51:37 +00:00
Add info page auto reload when config changes
This commit is contained in:
parent
5445c73b38
commit
3b63ed48d0
@ -117,7 +117,10 @@ public partial class Information : MSGComponentBase
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
this.ApplyFilters([], [ Event.ENTERPRISE_ENVIRONMENTS_CHANGED ]);
|
||||
await base.OnInitializedAsync();
|
||||
|
||||
this.RefreshEnterpriseConfigurationState();
|
||||
|
||||
this.osLanguage = await this.RustService.ReadUserLanguage();
|
||||
this.logPaths = await this.RustService.GetLogPaths();
|
||||
@ -141,10 +144,8 @@ public partial class Information : MSGComponentBase
|
||||
switch (triggeredEvent)
|
||||
{
|
||||
case Event.PLUGINS_RELOADED:
|
||||
this.configPlugins = PluginFactory.AvailablePlugins
|
||||
.Where(x => x.Type is PluginType.CONFIGURATION)
|
||||
.OfType<IAvailablePlugin>()
|
||||
.ToList();
|
||||
case Event.ENTERPRISE_ENVIRONMENTS_CHANGED:
|
||||
this.RefreshEnterpriseConfigurationState();
|
||||
await this.InvokeAsync(this.StateHasChanged);
|
||||
break;
|
||||
}
|
||||
@ -154,6 +155,16 @@ public partial class Information : MSGComponentBase
|
||||
|
||||
#endregion
|
||||
|
||||
private void RefreshEnterpriseConfigurationState()
|
||||
{
|
||||
this.configPlugins = PluginFactory.AvailablePlugins
|
||||
.Where(x => x.Type is PluginType.CONFIGURATION)
|
||||
.OfType<IAvailablePlugin>()
|
||||
.ToList();
|
||||
|
||||
this.enterpriseEnvironments = EnterpriseEnvironmentService.CURRENT_ENVIRONMENTS.ToList();
|
||||
}
|
||||
|
||||
private async Task DeterminePandocVersion()
|
||||
{
|
||||
this.pandocInstallation = await Pandoc.CheckAvailabilityAsync(this.RustService, false);
|
||||
|
||||
@ -11,6 +11,7 @@ public enum Event
|
||||
STARTUP_PLUGIN_SYSTEM,
|
||||
STARTUP_COMPLETED,
|
||||
STARTUP_ENTERPRISE_ENVIRONMENT,
|
||||
ENTERPRISE_ENVIRONMENTS_CHANGED,
|
||||
PLUGINS_RELOADED,
|
||||
SHOW_ERROR,
|
||||
SHOW_WARNING,
|
||||
|
||||
@ -171,6 +171,9 @@ public sealed class EnterpriseEnvironmentService(ILogger<EnterpriseEnvironmentSe
|
||||
var effectiveSnapshot = BuildNormalizedSnapshot(effectiveEnvironments);
|
||||
CURRENT_ENVIRONMENTS = effectiveEnvironments;
|
||||
HasValidEnterpriseSnapshot = true;
|
||||
|
||||
if (!previousSnapshot.SequenceEqual(effectiveSnapshot))
|
||||
await MessageBus.INSTANCE.SendMessage<bool>(null, Event.ENTERPRISE_ENVIRONMENTS_CHANGED);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user