mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-12 10:21:36 +00:00
Allow to disable the component
This commit is contained in:
parent
f668388192
commit
3b2770dd5c
@ -1,5 +1,5 @@
|
|||||||
@inherits MSGComponentBase
|
@inherits MSGComponentBase
|
||||||
<MudButton StartIcon="@Icons.Material.Filled.Description" OnClick="async () => await this.SelectFile()" Variant="Variant.Filled" Class="mb-3">
|
<MudButton StartIcon="@Icons.Material.Filled.Description" OnClick="@(async () => await this.SelectFile())" Variant="Variant.Filled" Class="mb-3" Disabled="@this.Disabled">
|
||||||
@if (string.IsNullOrWhiteSpace(this.Text))
|
@if (string.IsNullOrWhiteSpace(this.Text))
|
||||||
{
|
{
|
||||||
@T("Use file content as input")
|
@T("Use file content as input")
|
||||||
|
|||||||
@ -16,6 +16,9 @@ public partial class ReadFileContent : MSGComponentBase
|
|||||||
[Parameter]
|
[Parameter]
|
||||||
public EventCallback<string> FileContentChanged { get; set; }
|
public EventCallback<string> FileContentChanged { get; set; }
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public bool Disabled { get; set; }
|
||||||
|
|
||||||
[Inject]
|
[Inject]
|
||||||
private RustService RustService { get; init; } = null!;
|
private RustService RustService { get; init; } = null!;
|
||||||
|
|
||||||
@ -30,6 +33,9 @@ public partial class ReadFileContent : MSGComponentBase
|
|||||||
|
|
||||||
private async Task SelectFile()
|
private async Task SelectFile()
|
||||||
{
|
{
|
||||||
|
if (this.Disabled)
|
||||||
|
return;
|
||||||
|
|
||||||
// Ensure that Pandoc is installed and ready:
|
// Ensure that Pandoc is installed and ready:
|
||||||
var pandocState = await this.PandocAvailabilityService.EnsureAvailabilityAsync(
|
var pandocState = await this.PandocAvailabilityService.EnsureAvailabilityAsync(
|
||||||
showSuccessMessage: false,
|
showSuccessMessage: false,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user