mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-05-17 07:52:14 +00:00
29 lines
988 B
C#
29 lines
988 B
C#
using AIStudio.Components;
|
|
using AIStudio.Tools.PluginSystem;
|
|
using AIStudio.Tools.PluginSystem.Assistants;
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace AIStudio.Pages;
|
|
|
|
public partial class Assistants : MSGComponentBase
|
|
{
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
this.ApplyFilters([], [ Event.CONFIGURATION_CHANGED, Event.PLUGINS_RELOADED ]);
|
|
await base.OnInitializedAsync();
|
|
}
|
|
|
|
private IReadOnlyCollection<PluginAssistants> AssistantPlugins =>
|
|
PluginFactory.RunningPlugins.OfType<PluginAssistants>()
|
|
.Where(plugin => this.SettingsManager.IsPluginEnabled(plugin))
|
|
.ToList();
|
|
|
|
protected override Task ProcessIncomingMessage<T>(ComponentBase? sendingComponent, Event triggeredEvent, T? data) where T : default
|
|
{
|
|
if (triggeredEvent is Event.CONFIGURATION_CHANGED or Event.PLUGINS_RELOADED)
|
|
return this.InvokeAsync(this.StateHasChanged);
|
|
|
|
return Task.CompletedTask;
|
|
}
|
|
}
|