mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-12 21:41:36 +00:00
Optimized path handling
This commit is contained in:
parent
0d4602aa7b
commit
b3be2f30bc
@ -68,9 +68,9 @@ else
|
|||||||
</MudStack>
|
</MudStack>
|
||||||
<div @onmouseenter="@this.OnMouseEnter" @onmouseleave="@this.OnMouseLeave">
|
<div @onmouseenter="@this.OnMouseEnter" @onmouseleave="@this.OnMouseLeave">
|
||||||
<MudPaper Height="20em" Outlined="true" Class="@this.dragClass" Style="overflow-y: auto;">
|
<MudPaper Height="20em" Outlined="true" Class="@this.dragClass" Style="overflow-y: auto;">
|
||||||
@foreach (var fileInfo in this.DocumentPaths.Select(file => new FileInfo(file)))
|
@foreach (var filePath in this.DocumentPaths)
|
||||||
{
|
{
|
||||||
<MudChip T="string" Color="Color.Dark" Text="@fileInfo.Name" tabindex="-1" Icon="@Icons.Material.Filled.Search" OnClick="@(() => this.InvestigateFile(@fileInfo))" OnClose="@(() => this.RemoveDocumentPathFromDocumentPaths(@fileInfo))"/>
|
<MudChip T="string" Color="Color.Dark" Text="@Path.GetFileName(filePath)" tabindex="-1" Icon="@Icons.Material.Filled.Search" OnClick="@(() => this.InvestigateFile(filePath))" OnClose="@(() => this.RemoveDocument(filePath))"/>
|
||||||
}
|
}
|
||||||
</MudPaper>
|
</MudPaper>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -199,9 +199,9 @@ public partial class AttachDocuments : MSGComponentBase
|
|||||||
this.StateHasChanged();
|
this.StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task RemoveDocumentPathFromDocumentPaths(FileInfo file)
|
private async Task RemoveDocument(string filePath)
|
||||||
{
|
{
|
||||||
this.DocumentPaths.Remove(file.ToString());
|
this.DocumentPaths.Remove(filePath);
|
||||||
|
|
||||||
await this.DocumentPathsChanged.InvokeAsync(this.DocumentPaths);
|
await this.DocumentPathsChanged.InvokeAsync(this.DocumentPaths);
|
||||||
await this.OnChange(this.DocumentPaths);
|
await this.OnChange(this.DocumentPaths);
|
||||||
@ -210,12 +210,12 @@ public partial class AttachDocuments : MSGComponentBase
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The user might want to check what we actually extract from his file and therefore give the LLM as an input.
|
/// The user might want to check what we actually extract from his file and therefore give the LLM as an input.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="file">The file to check.</param>
|
/// <param name="filePath">The file to check.</param>
|
||||||
private async Task InvestigateFile(FileInfo file)
|
private async Task InvestigateFile(string filePath)
|
||||||
{
|
{
|
||||||
var dialogParameters = new DialogParameters<DocumentCheckDialog>
|
var dialogParameters = new DialogParameters<DocumentCheckDialog>
|
||||||
{
|
{
|
||||||
{ x => x.FilePath, file.FullName },
|
{ x => x.FilePath, filePath },
|
||||||
};
|
};
|
||||||
|
|
||||||
await this.DialogService.ShowAsync<DocumentCheckDialog>(T("Document Preview"), dialogParameters, DialogOptions.FULLSCREEN);
|
await this.DialogService.ShowAsync<DocumentCheckDialog>(T("Document Preview"), dialogParameters, DialogOptions.FULLSCREEN);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user