mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 21:47:22 +00:00
Upgraded to MudBlazor 9 (#1137)
This commit is contained in:
1 parent
e0337a99bc
commit
aeba1fbccc
625 files changed
+408
-882
No files matched your search
@@ -251,7 +251,7 @@ public partial class EmbeddingProviderDialog : MSGComponentBase, ISecretId
|
||||
if (this.DataLLMProvider is not LLMProviders.SELF_HOSTED && !this.IsEnterpriseConfiguration)
|
||||
{
|
||||
this.dataAPIKeyStorageIssue = string.Format(T("Failed to load the API key from the operating system. The message was: {0}. You might ignore this message and provide the API key again."), requestedSecret.Issue);
|
||||
await this.form.Validate();
|
||||
await this.form.ValidateAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ public partial class EmbeddingProviderDialog : MSGComponentBase, ISecretId
|
||||
// Reset the validation when not editing and on the first render.
|
||||
// We don't want to show validation errors when the user opens the dialog.
|
||||
if(!this.IsEditing && firstRender)
|
||||
this.form.ResetValidation();
|
||||
await this.form.ResetValidationAsync();
|
||||
|
||||
await base.OnAfterRenderAsync(firstRender);
|
||||
}
|
||||
@@ -298,7 +298,7 @@ public partial class EmbeddingProviderDialog : MSGComponentBase, ISecretId
|
||||
|
||||
this.dataStoreWasAttempted = true;
|
||||
await this.dataTokenizerValidationTask;
|
||||
await this.form.Validate();
|
||||
await this.form.ValidateAsync();
|
||||
this.dataAPIKeyStorageIssue = string.Empty;
|
||||
|
||||
// Manually validate the model selection (needed when no models are loaded
|
||||
@@ -343,7 +343,7 @@ public partial class EmbeddingProviderDialog : MSGComponentBase, ISecretId
|
||||
if (!response.Success)
|
||||
{
|
||||
this.dataCustomTokenizerValidationIssue = string.IsNullOrWhiteSpace(response.Message) ? string.Empty : response.Message;
|
||||
await this.form.Validate();
|
||||
await this.form.ValidateAsync();
|
||||
return;
|
||||
}
|
||||
this.dataFilePath = response.StoredPath;
|
||||
@@ -358,7 +358,7 @@ public partial class EmbeddingProviderDialog : MSGComponentBase, ISecretId
|
||||
if (!storeResponse.Success)
|
||||
{
|
||||
this.dataAPIKeyStorageIssue = string.Format(T("Failed to store the API key in the operating system. The message was: {0}. Please try again."), storeResponse.Issue);
|
||||
await this.form.Validate();
|
||||
await this.form.ValidateAsync();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -372,7 +372,7 @@ public partial class EmbeddingProviderDialog : MSGComponentBase, ISecretId
|
||||
if (!deleteResponse.Success)
|
||||
{
|
||||
this.dataAPIKeyStorageIssue = string.Format(T("Failed to remove the API key from the operating system. The message was: {0}. Please try again."), deleteResponse.Issue);
|
||||
await this.form.Validate();
|
||||
await this.form.ValidateAsync();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -406,7 +406,7 @@ public partial class EmbeddingProviderDialog : MSGComponentBase, ISecretId
|
||||
if (!string.IsNullOrWhiteSpace(this.dataAPIKeyStorageIssue))
|
||||
{
|
||||
this.dataAPIKeyStorageIssue = string.Empty;
|
||||
await this.form.Validate();
|
||||
await this.form.ValidateAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -457,8 +457,9 @@ public partial class EmbeddingProviderDialog : MSGComponentBase, ISecretId
|
||||
await this.MessageBus.SendWarning(new(Icons.Material.Filled.Warning, T("Please drop a tokenizer file in the JSON format.")));
|
||||
}
|
||||
|
||||
private async Task OnDataFilePathChanged(string filePath)
|
||||
private async Task OnDataFilePathChanged(string? changedFilePath)
|
||||
{
|
||||
var filePath = changedFilePath ?? string.Empty;
|
||||
this.dataFilePath = filePath;
|
||||
var validationRevision = ++this.dataTokenizerValidationRevision;
|
||||
this.dataTokenizerValidationTask = this.ValidateCustomTokenizer(filePath, validationRevision);
|
||||
@@ -477,9 +478,9 @@ public partial class EmbeddingProviderDialog : MSGComponentBase, ISecretId
|
||||
this.dataTokenizerFingerprint = tokenizerFingerprint;
|
||||
|
||||
if (this.dataStoreWasAttempted)
|
||||
await this.form.Validate();
|
||||
await this.form.ValidateAsync();
|
||||
else
|
||||
this.form.ResetValidation();
|
||||
await this.form.ResetValidationAsync();
|
||||
}
|
||||
|
||||
private async Task ValidateCustomTokenizer(string filePath, int validationRevision)
|
||||
|
||||
Reference in new issue
Block a user