Files
AI-Studio/app/MindWork AI Studio/Components/Settings/SettingsPanelTools.razor
T

79 lines
3.9 KiB
Plaintext

@inherits SettingsPanelBase
<ExpansionPanel HeaderIcon="@Icons.Material.Filled.Build" HeaderText="@T("Tool Settings")">
<MudText Typo="Typo.body1" Class="mb-4">
@T("Configure global settings for each tool.") @T("Switch off the tools you never need: they then appear in no tool selection, and the AI cannot use them.")
</MudText>
<MudTable Items="@this.items" Hover="@true" Dense="@true">
<HeaderContent>
<MudTh>@T("Enabled")</MudTh>
<MudTh>@T("Icon")</MudTh>
<MudTh>@T("Name")</MudTh>
<MudTh>@T("Description")</MudTh>
<MudTh>@T("Minimum provider confidence")</MudTh>
<MudTh>@T("Status")</MudTh>
<MudTh>@T("Settings")</MudTh>
</HeaderContent>
<RowTemplate>
<MudTd>
<MudTooltip Text="@this.GetSwitchTooltip(context)">
<MudSwitch T="bool" Value="@context.IsActive" ValueChanged="@(isOn => this.SwitchToolOnOrOff(context, isOn))" Disabled="@IsSwitchLocked(context)" Color="Color.Primary" />
</MudTooltip>
</MudTd>
<MudTd>
<MudIcon Icon="@context.Icon" Color="Color.Info" />
</MudTd>
<MudTd>
<MudText Typo="Typo.body1">@context.DisplayName</MudText>
</MudTd>
<MudTd>
<MudText Typo="Typo.body2">@context.Description</MudText>
</MudTd>
<MudTd>
<MudMenu StartIcon="@Icons.Material.Filled.Security" EndIcon="@Icons.Material.Filled.KeyboardArrowDown" Label="@this.GetCurrentConfidenceLevelName(context)" Variant="Variant.Filled" Style="@this.SetCurrentConfidenceLevelColorStyle(context)" Disabled="@this.IsToolConfidenceManaged()">
@foreach (var confidenceLevel in this.GetSelectableConfidenceLevels())
{
<MudMenuItem OnClick="@(async () => await this.ChangeMinimumProviderConfidence(context, confidenceLevel))">
@this.GetConfidenceLevelName(confidenceLevel)
</MudMenuItem>
}
</MudMenu>
</MudTd>
<MudTd>
@if (IsSwitchedOffByUser(context))
{
@* Whether its settings are complete does not matter while nobody can use the tool: *@
<MudTooltip Text="@T("You switched off this tool. It appears in no tool selection, and the AI cannot use it.")">
<MudIcon Icon="@Icons.Material.Filled.VisibilityOff" Color="Color.Default" />
</MudTooltip>
}
else if (!context.IsActive)
{
<MudTooltip Text="@T("This tool has been disabled by your organization.")">
<MudIcon Icon="@Icons.Material.Filled.Lock" Color="Color.Error" />
</MudTooltip>
}
else if (context.ConfigurationState.IsConfigured)
{
<MudIcon Icon="@Icons.Material.Filled.CheckCircle" Color="Color.Success" />
}
else
{
<MudTooltip Text="@this.GetConfigurationTooltip(context)">
<MudIcon Icon="@Icons.Material.Filled.Warning" Color="Color.Warning" />
</MudTooltip>
}
</MudTd>
<MudTd>
<MudStack Row="true" Wrap="Wrap.NoWrap" AlignItems="AlignItems.Center" Spacing="0">
<MudTooltip Text="@T("Settings")">
<MudIconButton Icon="@Icons.Material.Filled.Settings" OnClick="@(async () => await this.OpenSettings(context))" aria-label="@T("Settings")" />
</MudTooltip>
<AdminExportButton OnClick="@(() => this.OpenExport(context))" />
</MudStack>
</MudTd>
</RowTemplate>
</MudTable>
</ExpansionPanel>