mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-13 09:01:37 +00:00
Fix crash in local data sources dialog for directories
This commit is contained in:
parent
0ee576f8e9
commit
3146a52f40
@ -41,7 +41,7 @@
|
||||
<TextInfoLine Label="@T("Maximum matches per query")" Value="@this.DataSource.MaxMatches.ToString()" ClipboardTooltipSubject="@T("the maximum number of matches per query")"/>
|
||||
|
||||
<TextInfoLine Icon="@Icons.Material.Filled.SquareFoot" Label="@T("Number of files")" Value="@this.NumberFilesInDirectory" ClipboardTooltipSubject="@T("the number of files in the directory")"/>
|
||||
<TextInfoLines Label="@T("Files list")" MaxLines="14" Value="@this.directoryFiles.ToString()" ClipboardTooltipSubject="@T("the files list")"/>
|
||||
<TextInfoLines Label="@T("Files list")" MaxLines="14" Value="@this.directoryFilesText" ClipboardTooltipSubject="@T("the files list")"/>
|
||||
@if (this.directorySizeNumFiles > 100)
|
||||
{
|
||||
<MudJustifiedText Typo="Typo.body1" Color="Color.Warning" Class="mb-3">
|
||||
|
||||
@ -51,6 +51,7 @@ public partial class DataSourceLocalDirectoryInfoDialog : MSGComponentBase, IAsy
|
||||
private long directorySizeBytes;
|
||||
private long directorySizeNumFiles;
|
||||
private readonly StringBuilder directoryFiles = new();
|
||||
private string directoryFilesText = string.Empty;
|
||||
private Task directorySizeTask = Task.CompletedTask;
|
||||
|
||||
private bool IsOperationInProgress { get; set; } = true;
|
||||
@ -63,6 +64,7 @@ public partial class DataSourceLocalDirectoryInfoDialog : MSGComponentBase, IAsy
|
||||
{
|
||||
this.directoryFiles.Append("- ");
|
||||
this.directoryFiles.AppendLine(file);
|
||||
this.directoryFilesText = this.directoryFiles.ToString();
|
||||
}
|
||||
|
||||
private void UpdateDirectorySize(long size)
|
||||
|
||||
@ -4,3 +4,4 @@
|
||||
- Improved the document analysis assistant (in preview) by adding descriptions to the different sections.
|
||||
- Improved the document preview dialog for the document analysis assistant (in preview), providing Markdown and plain text views for attached files.
|
||||
- Improved the ID handling for configuration plugins.
|
||||
- Fixed a bug in the local data sources info dialog (preview feature) for data directories that could cause the app to crash. The error was caused by a background thread producing data while the frontend attempted to display it.
|
||||
Loading…
Reference in New Issue
Block a user