diff --git a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua index 41b95033..25cb78a0 100644 --- a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua +++ b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua @@ -1015,6 +1015,12 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::READWEBCONTENT::T3825586228"] = "Please p -- Show web content options UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::READWEBCONTENT::T4249712357"] = "Show web content options" +-- Hide content +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SECRETINPUTFIELD::T1273315904"] = "Hide content" + +-- Show content +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SECRETINPUTFIELD::T2891011873"] = "Show content" + -- Spellchecking is disabled UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELAPP::T1059411425"] = "Spellchecking is disabled" diff --git a/app/MindWork AI Studio/Components/SecretInputField.razor b/app/MindWork AI Studio/Components/SecretInputField.razor new file mode 100644 index 00000000..c1e9ddba --- /dev/null +++ b/app/MindWork AI Studio/Components/SecretInputField.razor @@ -0,0 +1,20 @@ +@inherits MSGComponentBase + + + + + + + \ No newline at end of file diff --git a/app/MindWork AI Studio/Components/SecretInputField.razor.cs b/app/MindWork AI Studio/Components/SecretInputField.razor.cs new file mode 100644 index 00000000..e4c63a56 --- /dev/null +++ b/app/MindWork AI Studio/Components/SecretInputField.razor.cs @@ -0,0 +1,54 @@ +using Microsoft.AspNetCore.Components; + +namespace AIStudio.Components; + +public partial class SecretInputField : MSGComponentBase +{ + private static readonly Dictionary SPELLCHECK_ATTRIBUTES = new(); + + [Parameter] + public string Secret { get; set; } = string.Empty; + + [Parameter] + public EventCallback SecretChanged { get; set; } + + [Parameter] + public string Label { get; set; } = string.Empty; + + [Parameter] + public string Placeholder { get; set; } = string.Empty; + + [Parameter] + public Func Validation { get; set; } = _ => null; + + [Parameter] + public string Class { get; set; } = "mb-3"; + + #region Overrides of MSGComponentBase + + protected override async Task OnInitializedAsync() + { + await base.OnInitializedAsync(); + + // Configure the spellchecking for the instance name input: + this.SettingsManager.InjectSpellchecking(SPELLCHECK_ATTRIBUTES); + } + + #endregion + + private bool isSecretVisible; + + private InputType InputType => this.isSecretVisible ? InputType.Text : InputType.Password; + + private string InputTypeIcon => this.isSecretVisible ? Icons.Material.Filled.Visibility : Icons.Material.Filled.VisibilityOff; + + private string ToggleVisibilityTooltip => this.isSecretVisible ? T("Hide content") : T("Show content"); + + private Task OnSecretChanged(string arg) + { + this.Secret = arg; + return this.SecretChanged.InvokeAsync(arg); + } + + private void ToggleVisibility() => this.isSecretVisible = !this.isSecretVisible; +} \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/DataSourceERI_V1Dialog.razor b/app/MindWork AI Studio/Dialogs/DataSourceERI_V1Dialog.razor index 3f7d208b..c4069f32 100644 --- a/app/MindWork AI Studio/Dialogs/DataSourceERI_V1Dialog.razor +++ b/app/MindWork AI Studio/Dialogs/DataSourceERI_V1Dialog.razor @@ -96,20 +96,7 @@ UserAttributes="@SPELLCHECK_ATTRIBUTES"/> } - @* ReSharper disable once CSharpWarnings::CS8974 *@ - + } @if (this.availableRetrievalProcesses.Count > 0) diff --git a/app/MindWork AI Studio/Dialogs/EmbeddingProviderDialog.razor b/app/MindWork AI Studio/Dialogs/EmbeddingProviderDialog.razor index 80a64e6d..c79c80dd 100644 --- a/app/MindWork AI Studio/Dialogs/EmbeddingProviderDialog.razor +++ b/app/MindWork AI Studio/Dialogs/EmbeddingProviderDialog.razor @@ -25,18 +25,7 @@ @if (this.DataLLMProvider.IsAPIKeyNeeded(this.DataHost)) { - @* ReSharper disable once CSharpWarnings::CS8974 *@ - + } @if (this.DataLLMProvider.IsHostnameNeeded()) diff --git a/app/MindWork AI Studio/Dialogs/ProviderDialog.razor b/app/MindWork AI Studio/Dialogs/ProviderDialog.razor index 6f12fc78..9da54aaf 100644 --- a/app/MindWork AI Studio/Dialogs/ProviderDialog.razor +++ b/app/MindWork AI Studio/Dialogs/ProviderDialog.razor @@ -22,18 +22,7 @@ @if (this.DataLLMProvider.IsAPIKeyNeeded(this.DataHost)) { - @* ReSharper disable once CSharpWarnings::CS8974 *@ - + } @if (this.DataLLMProvider.IsHostnameNeeded()) diff --git a/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua b/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua index 6265b612..4da78a26 100644 --- a/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua +++ b/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua @@ -1017,6 +1017,12 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::READWEBCONTENT::T3825586228"] = "Bitte ge -- Show web content options UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::READWEBCONTENT::T4249712357"] = "Web-Inhalte anzeigen" +-- Hide content +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SECRETINPUTFIELD::T1273315904"] = "Inhalt ausblenden" + +-- Show content +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SECRETINPUTFIELD::T2891011873"] = "Inhalt anzeigen" + -- Spellchecking is disabled UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELAPP::T1059411425"] = "Rechtschreibprüfung ist deaktiviert" diff --git a/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua b/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua index f53446a6..55cf2a53 100644 --- a/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua +++ b/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua @@ -1017,6 +1017,12 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::READWEBCONTENT::T3825586228"] = "Please p -- Show web content options UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::READWEBCONTENT::T4249712357"] = "Show web content options" +-- Hide content +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SECRETINPUTFIELD::T1273315904"] = "Hide content" + +-- Show content +UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SECRETINPUTFIELD::T2891011873"] = "Show content" + -- Spellchecking is disabled UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::SETTINGS::SETTINGSPANELAPP::T1059411425"] = "Spellchecking is disabled" diff --git a/app/MindWork AI Studio/wwwroot/changelog/v0.9.45.md b/app/MindWork AI Studio/wwwroot/changelog/v0.9.45.md index 7fa36311..f22170ea 100644 --- a/app/MindWork AI Studio/wwwroot/changelog/v0.9.45.md +++ b/app/MindWork AI Studio/wwwroot/changelog/v0.9.45.md @@ -2,4 +2,5 @@ - Added chat templates. They are similar to common AI companies' playgrounds, where you can define your own system prompts and leverage assistant prompts for providers that support them. We thank Peer `peerschuett` for the work on this feature. - Added Russian as a language option for various assistants (e.g., translations, text summarization). - Improved chat options: you can access them directly from the chat interface. +- Improved password and API key input fields: they now optionally display their content to allow users to verify manual input. - Changed the design of the data source settings to match the new design. \ No newline at end of file