mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-08-11 19:12:11 +00:00
registered the csv file export as a plain text save
This commit is contained in:
parent
8c5efe5dea
commit
efd2bd2719
@ -74,6 +74,13 @@
|
||||
<MudMenuItem OnClick="@(() => this.ExportDocument(FileExportFormat.LATEX))" Icon="@Icons.Material.Filled.Functions">
|
||||
@T("LaTeX (.tex)")
|
||||
</MudMenuItem>
|
||||
@if (this.HasCsv)
|
||||
{
|
||||
<MudDivider />
|
||||
<MudMenuItem OnClick="@(() => this.ExportDocument(FileExportFormat.CSV))" Icon="@Icons.Material.Filled.TableChart">
|
||||
@T("CSV (.csv)")
|
||||
</MudMenuItem>
|
||||
}
|
||||
<MudDivider />
|
||||
<MudMenuItem OnClick="@(() => this.ExportDocument(FileExportFormat.MARKDOWN))" Icon="@Icons.Material.Filled.TextFields">
|
||||
@T("Markdown (.md)")
|
||||
|
||||
@ -106,6 +106,8 @@ public partial class ContentBlockComponent : MSGComponentBase, IAsyncDisposable
|
||||
private bool hasActiveMathContainer;
|
||||
private bool isDisposed;
|
||||
|
||||
private bool HasCsv => PlainFileExport.TryExtractCsvContent(this.Content, out _);
|
||||
|
||||
#region Overrides of ComponentBase
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
@ -555,6 +557,7 @@ public partial class ContentBlockComponent : MSGComponentBase, IAsyncDisposable
|
||||
switch (format)
|
||||
{
|
||||
case FileExportFormat.MARKDOWN:
|
||||
case FileExportFormat.CSV:
|
||||
await PlainFileExport.ToFile(this.RustService, format, this.Content);
|
||||
break;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user