diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelDataSources.razor b/app/MindWork AI Studio/Components/Settings/SettingsPanelDataSources.razor index 3f19bf9..506c63b 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelDataSources.razor +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelDataSources.razor @@ -1,4 +1,3 @@ -@using AIStudio.Settings @using AIStudio.Settings.DataModel @inherits SettingsPanelBase @@ -37,12 +36,7 @@ @this.GetEmbeddingName(context) - @if (context is IERIDataSource) - { - @* *@ - @* Show Information *@ - @* *@ - } + Edit diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelDataSources.razor.cs b/app/MindWork AI Studio/Components/Settings/SettingsPanelDataSources.razor.cs index 0312452..415ed5e 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelDataSources.razor.cs +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelDataSources.razor.cs @@ -216,10 +216,19 @@ public partial class SettingsPanelDataSources : SettingsPanelBase } } - private Task ShowInformation(IDataSource dataSource) + private async Task ShowInformation(IDataSource dataSource) { - #warning Implement the information dialog for ERI data sources. - return Task.CompletedTask; + switch (dataSource) + { + case DataSourceLocalFile localFile: + var localFileDialogParameters = new DialogParameters + { + { x => x.DataSource, localFile }, + }; + + await this.DialogService.ShowAsync("Local File Data Source Information", localFileDialogParameters, DialogOptions.FULLSCREEN); + break; + } } private async Task UpdateDataSources() diff --git a/app/MindWork AI Studio/Dialogs/DataSourceLocalFileInfoDialog.razor b/app/MindWork AI Studio/Dialogs/DataSourceLocalFileInfoDialog.razor new file mode 100644 index 0000000..828abf5 --- /dev/null +++ b/app/MindWork AI Studio/Dialogs/DataSourceLocalFileInfoDialog.razor @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + @if (!this.IsFileAvailable) + { + + The file chosen for the data source does not exist anymore. Please edit the data source and choose another file or correct the path. + + } + else + { + + The file chosen for the data source exists. + + } + + + + + + + + + + @if (this.IsCloudEmbedding) + { + + The embedding runs in the cloud. All your data within the + file '@this.DataSource.FilePath' will be sent to the cloud. + + } + else + { + + The embedding runs locally or in your organization. Your data is not sent to the cloud. + + } + + + + + + + + + + + Close + + \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/DataSourceLocalFileInfoDialog.razor.cs b/app/MindWork AI Studio/Dialogs/DataSourceLocalFileInfoDialog.razor.cs new file mode 100644 index 0000000..23fa068 --- /dev/null +++ b/app/MindWork AI Studio/Dialogs/DataSourceLocalFileInfoDialog.razor.cs @@ -0,0 +1,48 @@ +using AIStudio.Settings; +using AIStudio.Settings.DataModel; + +using Microsoft.AspNetCore.Components; + +namespace AIStudio.Dialogs; + +public partial class DataSourceLocalFileInfoDialog : ComponentBase +{ + [CascadingParameter] + private MudDialogInstance MudDialog { get; set; } = null!; + + [Parameter] + public DataSourceLocalFile DataSource { get; set; } + + [Inject] + private RustService RustService { get; init; } = null!; + + [Inject] + private ISnackbar Snackbar { get; init; } = null!; + + [Inject] + private SettingsManager SettingsManager { get; init; } = null!; + + #region Overrides of ComponentBase + + protected override async Task OnInitializedAsync() + { + this.embeddingProvider = this.SettingsManager.ConfigurationData.EmbeddingProviders.FirstOrDefault(x => x.Id == this.DataSource.EmbeddingId); + this.fileInfo = new FileInfo(this.DataSource.FilePath); + await base.OnInitializedAsync(); + } + + #endregion + + private EmbeddingProvider embeddingProvider; + private FileInfo fileInfo = null!; + + private bool IsCloudEmbedding => !this.embeddingProvider.IsSelfHosted; + + private bool IsFileAvailable => this.fileInfo.Exists; + + private string FileSize => this.fileInfo.FileSize(); + + private async Task CopyToClipboard(string content) => await this.RustService.CopyText2Clipboard(this.Snackbar, content); + + private void Close() => this.MudDialog.Close(); +} \ No newline at end of file diff --git a/app/MindWork AI Studio/packages.lock.json b/app/MindWork AI Studio/packages.lock.json index 17d7a38..2941da3 100644 --- a/app/MindWork AI Studio/packages.lock.json +++ b/app/MindWork AI Studio/packages.lock.json @@ -210,6 +210,6 @@ "type": "Project" } }, - "net8.0/osx-x64": {} + "net8.0/osx-arm64": {} } } \ No newline at end of file diff --git a/app/MindWork AI Studio/wwwroot/changelog/v0.9.28.md b/app/MindWork AI Studio/wwwroot/changelog/v0.9.28.md new file mode 100644 index 0000000..10511f8 --- /dev/null +++ b/app/MindWork AI Studio/wwwroot/changelog/v0.9.28.md @@ -0,0 +1,2 @@ +# v0.9.28, build 203 (2025-0x-xx xx:xx UTC) +- Added an information view to all data sources to the data source configuration page. The data source configuration is a preview feature behind the RAG feature flag. \ No newline at end of file