AI-Studio/app/MindWork AI Studio/Dialogs/Settings/ToolSettingsDialog.razor
Peer Hogeterp 7cedd03adb
Some checks are pending
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Sync Flatpak repo (push) Blocked by required conditions
Build and Release / Collect Flatpak artifacts (push) Blocked by required conditions
Build and Release / Verify (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
Added a free address choice to the Read Web Page tool (#997)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
2026-09-27 21:46:16 +02:00

89 lines
4.5 KiB
Plaintext

@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>
@if (!this.SettingsManager.IsToolActive(this.toolDefinition.Id))
{
<MudAlert Severity="Severity.Warning" Class="mb-4">@T("This tool has been disabled by your organization.")</MudAlert>
}
@if (!string.IsNullOrWhiteSpace(this.validationMessage))
{
<MudAlert Severity="Severity.Error" Class="mb-4">@this.validationMessage</MudAlert>
}
@foreach (var warning in this.GetSettingsWarnings())
{
<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 configuration-help-justified" 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 configuration-help-justified" HelperText="@this.GetFieldDescription(fieldName, field)" Placeholder="@this.GetFieldPlaceholder(fieldName, field)" InputType="@(field.Secret ? InputType.Password : InputType.Text)" Disabled="@this.IsFieldDisabled(fieldName)" />
}
}
</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>