mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-05-21 11:52:15 +00:00
53 lines
2.4 KiB
Plaintext
53 lines
2.4 KiB
Plaintext
@using AIStudio.Tools.ToolCallingSystem
|
|
@inherits SettingsDialogBase
|
|
|
|
<MudDialog>
|
|
<TitleContent>
|
|
<MudText Typo="Typo.h6" Class="d-flex align-center">
|
|
<MudIcon Icon="@this.implementation?.Icon" Class="mr-2" />
|
|
@(this.implementation?.GetDisplayName() ?? T("Tool Settings"))
|
|
</MudText>
|
|
</TitleContent>
|
|
<DialogContent>
|
|
@if (this.toolDefinition is null)
|
|
{
|
|
<MudText Typo="Typo.body1">@T("The selected tool could not be loaded.")</MudText>
|
|
}
|
|
else
|
|
{
|
|
<MudJustifiedText Typo="Typo.body1" Class="mb-4">
|
|
@this.implementation?.GetDescription()
|
|
</MudJustifiedText>
|
|
|
|
<MudPaper Class="pa-3 mb-4 border-dashed border rounded-lg">
|
|
@foreach (var property in this.toolDefinition.SettingsSchema.Properties)
|
|
{
|
|
var fieldName = property.Key;
|
|
var field = property.Value;
|
|
if (field.EnumValues.Count > 0)
|
|
{
|
|
<MudSelect T="string" Label="@this.GetFieldLabel(fieldName, field)" Value="@this.GetValue(fieldName)" ValueChanged="@(value => this.UpdateValue(fieldName, value))" Variant="Variant.Outlined" Margin="Margin.Dense" HelperText="@this.GetFieldDescription(fieldName, field)" Class="mb-3">
|
|
@foreach (var option in field.EnumValues)
|
|
{
|
|
<MudSelectItem T="string" Value="@option">@option</MudSelectItem>
|
|
}
|
|
</MudSelect>
|
|
}
|
|
else
|
|
{
|
|
<MudTextField T="string" Label="@this.GetFieldLabel(fieldName, field)" Value="@this.GetValue(fieldName)" ValueChanged="@(value => this.UpdateValue(fieldName, value))" Variant="Variant.Outlined" Margin="Margin.Dense" Class="mb-3" HelperText="@this.GetFieldDescription(fieldName, field)" InputType="@(field.Secret ? InputType.Password : InputType.Text)" />
|
|
}
|
|
}
|
|
</MudPaper>
|
|
}
|
|
</DialogContent>
|
|
<DialogActions>
|
|
<MudButton OnClick="@this.Close" Variant="Variant.Text">
|
|
@T("Cancel")
|
|
</MudButton>
|
|
<MudButton OnClick="@this.Save" Variant="Variant.Filled" Disabled="@(this.toolDefinition is null)">
|
|
@T("Save")
|
|
</MudButton>
|
|
</DialogActions>
|
|
</MudDialog>
|