mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-18 09:38:00 +00:00
added warning and improved error handling
This commit is contained in:
1 parent
759c7f9d89
commit
fd2d99872a
14 files changed
+240
-83
No files matched your search
@@ -54,4 +54,18 @@ public partial class Embeddings : MSGComponentBase
|
||||
DataSourceEmbeddingState.COMPLETED => Color.Success,
|
||||
_ => Color.Default,
|
||||
};
|
||||
|
||||
private bool CanRefresh(DataSourceEmbeddingStatus status)
|
||||
{
|
||||
return this.DataSourceEmbeddingService.CanRefreshDataSource(status.DataSourceId) &&
|
||||
status.State is not DataSourceEmbeddingState.RUNNING and not DataSourceEmbeddingState.QUEUED &&
|
||||
(status.State is DataSourceEmbeddingState.FAILED || status.FailedFiles > 0);
|
||||
}
|
||||
|
||||
private async Task RefreshDataSource(DataSourceEmbeddingStatus status)
|
||||
{
|
||||
await this.DataSourceEmbeddingService.QueueDataSourceAsync(status.DataSourceId);
|
||||
this.ReloadStatuses();
|
||||
await this.InvokeAsync(this.StateHasChanged);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user