mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-17 09:37:59 +00:00
Support multiple web search backends: SearXNG, Staan, and Tavily (#948)
This commit is contained in:
1 parent
4d8d30e15e
commit
4141e7c504
57 files changed
+3734
-1088
No files matched your search
@@ -28,31 +28,53 @@
|
||||
<MudAlert Severity="Severity.Error" Class="mb-4">@this.validationMessage</MudAlert>
|
||||
}
|
||||
|
||||
<MudPaper Class="pa-3 mb-4 border-dashed border rounded-lg">
|
||||
@foreach (var property in this.toolDefinition.SettingsSchema.Properties)
|
||||
@foreach (var warning in this.GetSettingsWarnings())
|
||||
{
|
||||
var fieldName = property.Key;
|
||||
var field = property.Value;
|
||||
var fieldOptions = field.GetOptions();
|
||||
if (fieldOptions.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)" Placeholder="@this.GetFieldPlaceholder(fieldName, field)" Class="mb-3" Disabled="@this.IsFieldDisabled(fieldName)">
|
||||
@if (!this.toolDefinition.SettingsSchema.Required.Contains(fieldName))
|
||||
{
|
||||
<MudSelectItem T="string" Value="@string.Empty">@T("Not set")</MudSelectItem>
|
||||
}
|
||||
@foreach (var option in fieldOptions)
|
||||
{
|
||||
<MudSelectItem T="string" Value="@option.Value">@option.Label</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)" Placeholder="@this.GetFieldPlaceholder(fieldName, field)" InputType="@(field.Secret ? InputType.Password : InputType.Text)" Disabled="@this.IsFieldDisabled(fieldName)" />
|
||||
}
|
||||
<MudAlert Severity="Severity.Warning" Class="mb-4">@warning</MudAlert>
|
||||
}
|
||||
|
||||
@foreach (var group in this.BuildVisibleFieldGroups())
|
||||
{
|
||||
<MudPaper Class="pa-3 mb-4 border-dashed border rounded-lg">
|
||||
@if (this.ShowsGroupHeader(group))
|
||||
{
|
||||
<MudStack Row="@true" AlignItems="AlignItems.Center" Justify="Justify.SpaceBetween" Wrap="Wrap.Wrap" Class="mb-3">
|
||||
<MudText Typo="Typo.subtitle2">@this.GetGroupLabel(group.Key)</MudText>
|
||||
<MudStack Row="@true" AlignItems="AlignItems.Center" Spacing="2" Wrap="Wrap.Wrap">
|
||||
@foreach (var link in this.GetGroupLinks(group.Key))
|
||||
{
|
||||
<MudButton Variant="Variant.Filled" Size="Size.Small" StartIcon="@link.Icon" Href="@link.Url" Target="_blank">
|
||||
@link.Label
|
||||
</MudButton>
|
||||
}
|
||||
</MudStack>
|
||||
</MudStack>
|
||||
}
|
||||
@foreach (var property in group.Fields)
|
||||
{
|
||||
var fieldName = property.Key;
|
||||
var field = property.Value;
|
||||
var fieldOptions = field.GetOptions();
|
||||
if (fieldOptions.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)" Placeholder="@this.GetFieldPlaceholder(fieldName, field)" Class="mb-3" Disabled="@this.IsFieldDisabled(fieldName)">
|
||||
@if (!this.toolDefinition.SettingsSchema.Required.Contains(fieldName))
|
||||
{
|
||||
<MudSelectItem T="string" Value="@string.Empty">@T("Not set")</MudSelectItem>
|
||||
}
|
||||
@foreach (var option in fieldOptions)
|
||||
{
|
||||
<MudSelectItem T="string" Value="@option.Value">@option.Label</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)" Placeholder="@this.GetFieldPlaceholder(fieldName, field)" InputType="@(field.Secret ? InputType.Password : InputType.Text)" Disabled="@this.IsFieldDisabled(fieldName)" />
|
||||
}
|
||||
}
|
||||
</MudPaper>
|
||||
}
|
||||
</MudPaper>
|
||||
}
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
|
||||
Reference in new issue
Block a user