mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-07-04 08:22:56 +00:00
154 lines
7.1 KiB
Plaintext
154 lines
7.1 KiB
Plaintext
@using AIStudio.Settings.DataModel
|
|
@using AIStudio.Tools.ERIClient.DataModel
|
|
@inherits MSGComponentBase
|
|
|
|
<MudDialog>
|
|
<DialogContent>
|
|
<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="40"
|
|
Counter="40"
|
|
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"/>
|
|
}
|
|
|
|
@* ReSharper disable once CSharpWarnings::CS8974 *@
|
|
<MudTextField
|
|
T="string"
|
|
@bind-Text="@this.dataSecret"
|
|
Label="@this.GetSecretLabel()"
|
|
Class="mb-6"
|
|
Immediate="@true"
|
|
Validation="@this.dataSourceValidation.ValidatingSecret"
|
|
Adornment="Adornment.Start"
|
|
AdornmentIcon="@Icons.Material.Filled.Security"
|
|
AdornmentColor="Color.Info"
|
|
Variant="Variant.Text"
|
|
InputType="InputType.Password"
|
|
UserAttributes="@SPELLCHECK_ATTRIBUTES"/>
|
|
}
|
|
|
|
@if (this.availableRetrievalProcesses.Count > 0)
|
|
{
|
|
<MudSelect @bind-Value="@this.dataSelectedRetrievalProcess" 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>
|
|
|
|
</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> |