mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 23:07:23 +00:00
150 lines
7.6 KiB
Plaintext
150 lines
7.6 KiB
Plaintext
@using AIStudio.Settings.DataModel
|
|
@using AIStudio.Tools.Validation
|
|
@using AIStudio.Tools.ERIClient.DataModel
|
|
@inherits MSGComponentBase
|
|
|
|
<MudDialog>
|
|
<DialogContent>
|
|
@if (!string.IsNullOrWhiteSpace(this.importRetrievalIssue))
|
|
{
|
|
<MudAlert Severity="Severity.Warning" Class="mb-2">@this.importRetrievalIssue</MudAlert>
|
|
}
|
|
<MudForm @ref="@this.form" @bind-IsValid="@this.dataIsValid" @bind-Errors="@this.dataIssues">
|
|
@* ReSharper disable once CSharpWarnings::CS8974 *@
|
|
<MudTextField
|
|
T="string"
|
|
@bind-Text="@this.dataName"
|
|
Label="@T("Data Source Name")"
|
|
Class="mb-6"
|
|
MaxLength="@DataSourceValidation.MAX_NAME_LENGTH"
|
|
Counter="@DataSourceValidation.MAX_NAME_LENGTH"
|
|
Immediate="@true"
|
|
Validation="@this.dataSourceValidation.ValidatingName"
|
|
Adornment="Adornment.Start"
|
|
AdornmentIcon="@Icons.Material.Filled.Lightbulb"
|
|
AdornmentColor="Color.Info"
|
|
UserAttributes="@SPELLCHECK_ATTRIBUTES"
|
|
/>
|
|
|
|
<MudStack Row="@true">
|
|
@* ReSharper disable once CSharpWarnings::CS8974 *@
|
|
<MudTextField
|
|
T="string"
|
|
@bind-Text="@this.dataHostname"
|
|
Label="@T("ERI v1 Server Hostname")"
|
|
Class="mb-6"
|
|
Immediate="@true"
|
|
Validation="@this.dataSourceValidation.ValidatingHostname"
|
|
Adornment="Adornment.Start"
|
|
AdornmentIcon="@Icons.Material.Filled.NetworkCheck"
|
|
AdornmentColor="Color.Info"
|
|
Variant="Variant.Text"
|
|
UserAttributes="@SPELLCHECK_ATTRIBUTES"/>
|
|
|
|
<MudNumericField
|
|
Label="@T("Port")"
|
|
Immediate="@true"
|
|
Min="1" Max="65535"
|
|
Validation="@this.dataSourceValidation.ValidatePort"
|
|
@bind-Value="@this.dataPort"
|
|
Variant="Variant.Text"
|
|
Margin="Margin.Dense"/>
|
|
</MudStack>
|
|
|
|
@if (!this.IsConnectionEncrypted())
|
|
{
|
|
<MudJustifiedText Typo="Typo.body1" Color="Color.Error" Class="mb-3">
|
|
@T("Please note: the connection to the ERI v1 server is not encrypted. This means that all data sent to the server is transmitted in plain text. Please ask the ERI server administrator to enable encryption.")
|
|
</MudJustifiedText>
|
|
}
|
|
|
|
@if (this.IsConnectionPossible())
|
|
{
|
|
<MudStack Row="@true" AlignItems="AlignItems.Center">
|
|
<MudButton Variant="Variant.Filled" Color="@this.GetTestResultColor()" StartIcon="@this.GetTestResultIcon()" Class="mb-3" OnClick="@this.TestConnection">
|
|
@T("Test connection & read available metadata")
|
|
</MudButton>
|
|
<MudText Typo="Typo.body1" Class="mb-3">
|
|
@this.GetTestResultText()
|
|
</MudText>
|
|
</MudStack>
|
|
}
|
|
|
|
@if(this.availableAuthMethods.Count > 0 || this.dataAuthMethod != default)
|
|
{
|
|
<MudSelect @bind-Value="@this.dataAuthMethod" Text="@this.dataAuthMethod.DisplayName()" Label="Authentication Method" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.dataSourceValidation.ValidateAuthMethod">
|
|
@foreach (var authMethod in this.availableAuthMethods)
|
|
{
|
|
<MudSelectItem Value="@authMethod">
|
|
@authMethod.DisplayName()
|
|
</MudSelectItem>
|
|
}
|
|
</MudSelect>
|
|
}
|
|
|
|
@if (this.NeedsSecret())
|
|
{
|
|
if (this.dataAuthMethod is AuthMethod.USERNAME_PASSWORD)
|
|
{
|
|
@* ReSharper disable once CSharpWarnings::CS8974 *@
|
|
<MudTextField
|
|
T="string"
|
|
@bind-Text="@this.dataUsername"
|
|
Label="@T("Username")"
|
|
Class="mb-6"
|
|
Immediate="@true"
|
|
Validation="@this.dataSourceValidation.ValidateUsername"
|
|
Adornment="Adornment.Start"
|
|
AdornmentIcon="@Icons.Material.Filled.Person2"
|
|
AdornmentColor="Color.Info"
|
|
Variant="Variant.Text"
|
|
UserAttributes="@SPELLCHECK_ATTRIBUTES"/>
|
|
}
|
|
|
|
<SecretInputField @bind-Secret="@this.dataSecret" Label="@this.GetSecretLabel()" Validation="@this.dataSourceValidation.ValidatingSecret" Class="mb-6"/>
|
|
}
|
|
|
|
@if (this.availableRetrievalProcesses.Count > 0)
|
|
{
|
|
<MudSelect @bind-Value="@this.dataSelectedRetrievalProcess" @bind-Value:after="@this.ClearImportRetrievalIssue" Text="@this.dataSelectedRetrievalProcess.Name" Label="@T("Select one retrieval process")" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.dataSourceValidation.ValidateRetrievalProcess">
|
|
@foreach (var retrievalProcess in this.availableRetrievalProcesses)
|
|
{
|
|
<MudSelectItem Value="@retrievalProcess">
|
|
@retrievalProcess.Name
|
|
</MudSelectItem>
|
|
}
|
|
</MudSelect>
|
|
}
|
|
|
|
<MudSelect @bind-Value="@this.dataSecurityPolicy" Text="@this.dataSecurityPolicy.ToSelectionText()" Label="@T("Your security policy")" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.dataSourceValidation.ValidateSecurityPolicy">
|
|
@foreach (var policy in Enum.GetValues<DataSourceSecurity>())
|
|
{
|
|
<MudSelectItem Value="@policy">
|
|
@policy.ToSelectionText()
|
|
</MudSelectItem>
|
|
}
|
|
</MudSelect>
|
|
|
|
<OutboundDataRestrictionSelection @bind-Value="@this.SelectedOutboundDataRestriction" Label="@T("Where a chat may send data after reading this data source")" Explanation="@T("This setting decides where a chat may still send data once the AI found something in this data source, so that its content does not end up in a web search, for example. Choose no restriction only for content anybody may read anyway.")" OrganizationMinimum="@this.OrganizationMinimumOutboundDataRestriction" SecurityPolicy="@this.dataSecurityPolicy"/>
|
|
|
|
<MudNumericField T="ushort" Min="10" @bind-Value="@this.dataMaxMatches" Label="@T("How many matches do you want at most per query?")" Variant="Variant.Outlined" Step="10" />
|
|
|
|
</MudForm>
|
|
<Issues IssuesData="@this.dataIssues"/>
|
|
</DialogContent>
|
|
<DialogActions>
|
|
<MudButton OnClick="@this.Cancel" Variant="Variant.Filled">
|
|
@T("Cancel")
|
|
</MudButton>
|
|
<MudButton OnClick="@this.Store" Variant="Variant.Filled" Color="Color.Primary">
|
|
@if(this.IsEditing)
|
|
{
|
|
@T("Update")
|
|
}
|
|
else
|
|
{
|
|
@T("Add")
|
|
}
|
|
</MudButton>
|
|
</DialogActions>
|
|
</MudDialog> |