diff --git a/Oqtane.Client/Installer/Controls/MySQLConfig.razor b/Oqtane.Client/Installer/Controls/MySQLConfig.razor index 735285d48..98e64a211 100644 --- a/Oqtane.Client/Installer/Controls/MySQLConfig.razor +++ b/Oqtane.Client/Installer/Controls/MySQLConfig.razor @@ -1,5 +1,6 @@ @namespace Oqtane.Installer.Controls @implements Oqtane.Interfaces.IDatabaseConfigControl +@inject IStringLocalizer SharedLocalizer
@@ -28,7 +29,10 @@
- +
+ + +
@@ -38,6 +42,13 @@ private string _database = "Oqtane-" + DateTime.UtcNow.ToString("yyyyMMddHHmm"); private string _uid = String.Empty; private string _pwd = String.Empty; + private string _passwordType = "password"; + private string _togglePassword = string.Empty; + + protected override async Task OnInitializedAsync() + { + _togglePassword = SharedLocalizer["ShowPassword"]; + } public string GetConnectionString() { @@ -55,4 +66,18 @@ return connectionString; } + + private void TogglePassword() + { + if (_passwordType == "password") + { + _passwordType = "text"; + _togglePassword = SharedLocalizer["HidePassword"]; + } + else + { + _passwordType = "password"; + _togglePassword = SharedLocalizer["ShowPassword"]; + } + } } \ No newline at end of file diff --git a/Oqtane.Client/Installer/Controls/PostgreSQLConfig.razor b/Oqtane.Client/Installer/Controls/PostgreSQLConfig.razor index 652e55dc3..a06581e63 100644 --- a/Oqtane.Client/Installer/Controls/PostgreSQLConfig.razor +++ b/Oqtane.Client/Installer/Controls/PostgreSQLConfig.razor @@ -1,6 +1,7 @@ @namespace Oqtane.Installer.Controls @implements Oqtane.Interfaces.IDatabaseConfigControl @inject IStringLocalizer Localizer +@inject IStringLocalizer SharedLocalizer
@@ -40,7 +41,10 @@
- +
+ + +
} @@ -52,6 +56,13 @@ private string _security = "integrated"; private string _uid = String.Empty; private string _pwd = String.Empty; + private string _passwordType = "password"; + private string _togglePassword = string.Empty; + + protected override async Task OnInitializedAsync() + { + _togglePassword = SharedLocalizer["ShowPassword"]; + } public string GetConnectionString() { @@ -80,4 +91,18 @@ return connectionString; } + + private void TogglePassword() + { + if (_passwordType == "password") + { + _passwordType = "text"; + _togglePassword = SharedLocalizer["HidePassword"]; + } + else + { + _passwordType = "password"; + _togglePassword = SharedLocalizer["ShowPassword"]; + } + } } \ No newline at end of file diff --git a/Oqtane.Client/Installer/Controls/SqlServerConfig.razor b/Oqtane.Client/Installer/Controls/SqlServerConfig.razor index f3ef53fbe..5eed9649d 100644 --- a/Oqtane.Client/Installer/Controls/SqlServerConfig.razor +++ b/Oqtane.Client/Installer/Controls/SqlServerConfig.razor @@ -35,7 +35,10 @@
- +
+ + +
} @@ -67,9 +70,16 @@ private string _security = "integrated"; private string _uid = String.Empty; private string _pwd = String.Empty; + private string _passwordType = "password"; + private string _togglePassword = string.Empty; private string _encryption = "false"; private string _trustservercertificate = "false"; + protected override async Task OnInitializedAsync() + { + _togglePassword = SharedLocalizer["ShowPassword"]; + } + public string GetConnectionString() { var connectionString = String.Empty; @@ -92,4 +102,18 @@ return connectionString; } + + private void TogglePassword() + { + if (_passwordType == "password") + { + _passwordType = "text"; + _togglePassword = SharedLocalizer["HidePassword"]; + } + else + { + _passwordType = "password"; + _togglePassword = SharedLocalizer["ShowPassword"]; + } + } } \ No newline at end of file