mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 00:19:48 +00:00
76 lines
3.5 KiB
Plaintext
76 lines
3.5 KiB
Plaintext
@using AIStudio.Settings.DataModel
|
|
@inherits SettingsDialogBase
|
|
|
|
<MudDialog>
|
|
<TitleContent>
|
|
<PreviewPrototype/>
|
|
<MudText Typo="Typo.h6" Class="d-flex align-center">
|
|
<MudIcon Icon="@Icons.Material.Filled.IntegrationInstructions" Class="mr-2"/>
|
|
@T("Configured Data Sources")
|
|
</MudText>
|
|
</TitleContent>
|
|
<DialogContent>
|
|
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
|
|
@T("You might configure different data sources. A data source can include one file, all files in a directory, or data from your company. Later, you can incorporate these data sources as needed when the AI requires this data to complete a certain task.")
|
|
</MudJustifiedText>
|
|
|
|
<MudTable Items="@this.SettingsManager.ConfigurationData.DataSources" Hover="@true" Class="border-dashed border rounded-lg">
|
|
<ColGroup>
|
|
<col style="width: 3em;"/>
|
|
<col/>
|
|
<col style="width: 12em;"/>
|
|
<col style="width: 12em;"/>
|
|
<col style="width: 40em;"/>
|
|
</ColGroup>
|
|
<HeaderContent>
|
|
<MudTh>#</MudTh>
|
|
<MudTh>@T("Name")</MudTh>
|
|
<MudTh>@T("Type")</MudTh>
|
|
<MudTh>@T("Embedding")</MudTh>
|
|
<MudTh>@T("Actions")</MudTh>
|
|
</HeaderContent>
|
|
<RowTemplate>
|
|
<MudTd>@context.Num</MudTd>
|
|
<MudTd>@context.Name</MudTd>
|
|
<MudTd>@context.Type.GetDisplayName()</MudTd>
|
|
<MudTd>@this.GetEmbeddingName(context)</MudTd>
|
|
|
|
<MudTd>
|
|
<MudStack Row="true" Class="mb-2 mt-2" Wrap="Wrap.Wrap">
|
|
<MudIconButton Variant="Variant.Filled" Color="Color.Info" Icon="@Icons.Material.Filled.Info" OnClick="() => this.ShowInformation(context)"/>
|
|
<MudButton Variant="Variant.Filled" Color="Color.Info" StartIcon="@Icons.Material.Filled.Edit" OnClick="() => this.EditDataSource(context)">
|
|
@T("Edit")
|
|
</MudButton>
|
|
<MudButton Variant="Variant.Filled" Color="Color.Error" StartIcon="@Icons.Material.Filled.Delete" OnClick="() => this.DeleteDataSource(context)">
|
|
@T("Delete")
|
|
</MudButton>
|
|
</MudStack>
|
|
</MudTd>
|
|
</RowTemplate>
|
|
</MudTable>
|
|
|
|
@if (this.SettingsManager.ConfigurationData.DataSources.Count == 0)
|
|
{
|
|
<MudText Typo="Typo.h6" Class="mt-3">
|
|
@T("No data sources configured yet.")
|
|
</MudText>
|
|
}
|
|
|
|
<MudMenu EndIcon="@Icons.Material.Filled.KeyboardArrowDown" Label="@T("Add Data Source")" Color="Color.Primary" Variant="Variant.Filled" AnchorOrigin="Origin.CenterCenter" TransformOrigin="Origin.TopLeft" Class="mt-3 mb-6">
|
|
<MudMenuItem OnClick="() => this.AddDataSource(DataSourceType.ERI_V1)">
|
|
@T("External Data (ERI-Server v1)")
|
|
</MudMenuItem>
|
|
<MudMenuItem OnClick="() => this.AddDataSource(DataSourceType.LOCAL_DIRECTORY)">
|
|
@T("Local Directory")
|
|
</MudMenuItem>
|
|
<MudMenuItem OnClick="() => this.AddDataSource(DataSourceType.LOCAL_FILE)">
|
|
@T("Local File")
|
|
</MudMenuItem>
|
|
</MudMenu>
|
|
</DialogContent>
|
|
<DialogActions>
|
|
<MudButton OnClick="@this.Close" Variant="Variant.Filled">
|
|
@T("Close")
|
|
</MudButton>
|
|
</DialogActions>
|
|
</MudDialog> |