@using AIStudio.Settings
@using AIStudio.Settings.DataModel
@inherits MSGComponentBase
@if (this.AreMailboxesEnabled)
{
@T("You might configure different data sources. A data source can include one file, all files in a directory, a mailbox, 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.")
}
else
{
@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.")
}
@{ var embeddingStatuses = this.DataSourceEmbeddingService.GetStatuses().ToDictionary(status => status.DataSourceId, StringComparer.OrdinalIgnoreCase); }
#
@T("Name")
@T("Type")
@T("Embedding")
@T("Indexed")
@T("Actions")
@{ var embeddingStatus = embeddingStatuses.GetValueOrDefault(context.Id); }
@context.Num
@*
The name gets the room the other columns leave, which in the dialog was next to nothing: it
may break anywhere, so a single character was enough for the browser. The minimum width
keeps it readable, and the type and the embedding wrap instead, so that the table still fits.
The minimum sits on a div, since browsers differ in whether they honor it on a table cell.
With "break-word" instead, a long name without spaces would push the table out of the dialog.
*@
@context.Name
@context.Type.GetDisplayName()
@this.GetEmbeddingName(context)
@if (context is IIndexedDataSource)
{
@(embeddingStatus is null ? T("Not available") : string.Format(T("{0} of {1}"), embeddingStatus.IndexedDocuments.CompactCount(), embeddingStatus.TotalDocuments.CompactCount()))
}
else
{
@* Deliberately muted instead of colored: there is nothing to index and nothing to fix here. *@
@T("Not applicable")
}
@if (context is IDataSource dataSource)
{
}
@*
Outside the two branches below on purpose: an index which cannot be read is a
matter of this machine, not of the configuration. Hiding the repair for a data
source the organization manages would leave it locked out of every chat with no
way back, and the selection points here for it.
*@
@if (this.CanRepairDataSource(context))
{
}
@if (context.IsEnterpriseConfiguration)
{
}
else
{
@if (context is DataSourceERI_V1)
{
}
}
@if (!this.ConfiguredDataSources.Any())
{
@T("No data sources configured yet.")
}