diff --git a/SqlDatabaseVectorSearch/Components/Layout/MainLayout.razor b/SqlDatabaseVectorSearch/Components/Layout/MainLayout.razor index 11dbb73..b9e8526 100644 --- a/SqlDatabaseVectorSearch/Components/Layout/MainLayout.razor +++ b/SqlDatabaseVectorSearch/Components/Layout/MainLayout.razor @@ -7,8 +7,8 @@ diff --git a/SqlDatabaseVectorSearch/Components/Pages/Documents.razor b/SqlDatabaseVectorSearch/Components/Pages/Documents.razor index 19889a3..9b42243 100644 --- a/SqlDatabaseVectorSearch/Components/Pages/Documents.razor +++ b/SqlDatabaseVectorSearch/Components/Pages/Documents.razor @@ -10,11 +10,14 @@ Documents -

Upload new document

+

+ + Upload new document +

-
+
@@ -24,6 +27,17 @@
+
+
+ + + + + Document ID + + +
+
@@ -34,13 +48,18 @@ @if (documents.Count > 0) { -

Available documents

+

+ + Available documents +

+ + @@ -50,9 +69,11 @@ { + + @@ -82,6 +103,8 @@ [SupplyParameterFromForm] public IBrowserFile? File { get; set; } + public string? documentId { get; set; } + protected override async Task OnAfterRenderAsync(bool firstRender) { if (!firstRender) @@ -127,7 +150,7 @@ await using var inputStream = File.OpenReadStream(20 * 1024 * 1024); // 20 MB await using var stream = await inputStream.GetMemoryStreamAsync(); - await vectorSearchService.ImportAsync(stream, File.Name, MimeUtility.GetMimeMapping(File.Name), null); + await vectorSearchService.ImportAsync(stream, File.Name, MimeUtility.GetMimeMapping(File.Name), Guid.Parse(documentId)); CreateToastMessage(ToastType.Success, "Upload document", $"The document {File.Name} has been successfully uploaded and indexed.", await GetLocalDateTimeStringAsync(DateTimeOffset.UtcNow)); @@ -195,6 +218,8 @@ { public bool IsSelected { get; set; } + public string ContentType => MimeUtility.GetMimeMapping(Name); + public string LocalCreationDateString { get; set; } = string.Empty; } }
Id NameContent type Number of chunks Creation date
- + @document.Id @document.Name@document.ContentType @document.ChunkCount @document.LocalCreationDateString