mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-02-05 12:49:07 +00:00
Added triggers for configurations
This commit is contained in:
parent
906a09442d
commit
d09198d60b
@ -0,0 +1,7 @@
|
||||
@inherits ConfigurationBase
|
||||
|
||||
<MudField Label="@this.OptionDescription" Variant="Variant.Outlined" HelperText="@this.OptionHelp" Class="@MARGIN_CLASS">
|
||||
<MudButton Variant="Variant.Filled" StartIcon="@this.TriggerIcon" OnClick="@this.Click">
|
||||
@this.TriggerText
|
||||
</MudButton>
|
||||
</MudField>
|
@ -0,0 +1,24 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class ConfigurationTrigger : ConfigurationBase
|
||||
{
|
||||
[Parameter]
|
||||
public string TriggerText { get; set; } = string.Empty;
|
||||
|
||||
[Parameter]
|
||||
public string TriggerIcon { get; set; } = Icons.Material.Filled.AddBox;
|
||||
|
||||
[Parameter]
|
||||
public Action OnClickSync { get; set; } = () => { };
|
||||
|
||||
[Parameter]
|
||||
public Func<Task> OnClickAsync { get; set; } = () => Task.CompletedTask;
|
||||
|
||||
private async Task Click()
|
||||
{
|
||||
this.OnClickSync();
|
||||
await this.OnClickAsync();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user