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