mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-12 18:33:48 +00:00
Added admin dialog for tool configuration exports (#949)
This commit is contained in:
1 parent
4141e7c504
commit
88bf475847
24 files changed
+921
-102
No files matched your search
@@ -0,0 +1,35 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components;
|
||||
|
||||
/// <summary>
|
||||
/// The common admin-only configuration export action. Callers decide what is exported.
|
||||
/// </summary>
|
||||
public partial class AdminExportButton : MSGComponentBase
|
||||
{
|
||||
[Parameter]
|
||||
public EventCallback OnClick { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public Variant Variant { get; set; } = Variant.Text;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
this.ApplyFilters([], [ Event.CONFIGURATION_CHANGED ]);
|
||||
}
|
||||
|
||||
private async Task Export()
|
||||
{
|
||||
if (this.SettingsManager.ConfigurationData.App.ShowAdminSettings)
|
||||
await this.OnClick.InvokeAsync();
|
||||
}
|
||||
|
||||
protected override Task ProcessIncomingMessage<T>(ComponentBase? sendingComponent, Event triggeredEvent, T? data) where T : default
|
||||
{
|
||||
if (triggeredEvent is Event.CONFIGURATION_CHANGED)
|
||||
this.StateHasChanged();
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user