Allow for entry of raw connection string during installation
This commit is contained in:
parent
6bfab696ad
commit
e61a6df4d7
|
@ -35,13 +35,27 @@
|
|||
}
|
||||
</div>
|
||||
</div>
|
||||
@{
|
||||
if (_databaseConfigType != null)
|
||||
{
|
||||
@DatabaseConfigComponent;
|
||||
}
|
||||
}
|
||||
</div>
|
||||
@if (!_showConnectionString)
|
||||
{
|
||||
if (_databaseConfigType != null)
|
||||
{
|
||||
@DatabaseConfigComponent
|
||||
}
|
||||
<br />
|
||||
<button type="button" class="btn btn-secondary" @onclick="ToggleConnectionString">@Localizer["EnterConnectionString"]</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="row mb-1 align-items-center">
|
||||
<Label Class="col-sm-3" For="connectionstring" HelpText="Enter a complete connection string including all parameters and delimiters" ResourceKey="ConnectionString">String:</Label>
|
||||
<div class="col-sm-9">
|
||||
<textarea id="connectionstring" class="form-control" @bind="@_connectionString" rows="3"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<button type="button" class="btn btn-secondary" @onclick="ToggleConnectionString">@Localizer["EnterConnectionParameters"]</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-center">
|
||||
<h2>@Localizer["ApplicationAdmin"]</h2><br />
|
||||
|
@ -100,13 +114,15 @@
|
|||
private Type _databaseConfigType;
|
||||
private object _databaseConfig;
|
||||
private RenderFragment DatabaseConfigComponent { get; set; }
|
||||
private bool _showConnectionString = false;
|
||||
private string _connectionString = string.Empty;
|
||||
|
||||
private string _hostUsername = string.Empty;
|
||||
private string _hostPassword = string.Empty;
|
||||
private string _passwordType = "password";
|
||||
private string _confirmPasswordType = "password";
|
||||
private string _confirmPasswordType = "password";
|
||||
private string _togglePassword = string.Empty;
|
||||
private string _toggleConfirmPassword = string.Empty;
|
||||
private string _toggleConfirmPassword = string.Empty;
|
||||
private string _confirmPassword = string.Empty;
|
||||
private string _hostEmail = string.Empty;
|
||||
private bool _register = true;
|
||||
|
@ -116,7 +132,7 @@
|
|||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
_togglePassword = SharedLocalizer["ShowPassword"];
|
||||
_toggleConfirmPassword = SharedLocalizer["ShowPassword"];
|
||||
_toggleConfirmPassword = SharedLocalizer["ShowPassword"];
|
||||
|
||||
_databases = await DatabaseService.GetDatabasesAsync();
|
||||
if (_databases.Exists(item => item.IsDefault))
|
||||
|
@ -172,9 +188,16 @@
|
|||
private async Task Install()
|
||||
{
|
||||
var connectionString = String.Empty;
|
||||
if (_databaseConfig is IDatabaseConfigControl databaseConfigControl)
|
||||
if (_showConnectionString)
|
||||
{
|
||||
connectionString = databaseConfigControl.GetConnectionString();
|
||||
connectionString = _connectionString;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_databaseConfig is IDatabaseConfigControl databaseConfigControl)
|
||||
{
|
||||
connectionString = databaseConfigControl.GetConnectionString();
|
||||
}
|
||||
}
|
||||
|
||||
if (connectionString != "" && !string.IsNullOrEmpty(_hostUsername) && !string.IsNullOrEmpty(_hostPassword) && _hostPassword == _confirmPassword && !string.IsNullOrEmpty(_hostEmail) && _hostEmail.Contains("@"))
|
||||
|
@ -218,12 +241,12 @@
|
|||
{
|
||||
_message = Localizer["Message.Password.Invalid"];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_message = Localizer["Message.Require.DbInfo"];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_message = Localizer["Message.Require.DbInfo"];
|
||||
}
|
||||
}
|
||||
|
||||
private void TogglePassword()
|
||||
{
|
||||
|
@ -239,7 +262,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
private void ToggleConfirmPassword()
|
||||
private void ToggleConfirmPassword()
|
||||
{
|
||||
if (_confirmPasswordType == "password")
|
||||
{
|
||||
|
@ -252,4 +275,14 @@
|
|||
_toggleConfirmPassword = SharedLocalizer["ShowPassword"];
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleConnectionString()
|
||||
{
|
||||
if (_databaseConfig is IDatabaseConfigControl databaseConfigControl)
|
||||
{
|
||||
_connectionString = databaseConfigControl.GetConnectionString();
|
||||
}
|
||||
_showConnectionString = !_showConnectionString;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@
|
|||
<value>Server:</value>
|
||||
</data>
|
||||
<data name="Server.HelpText" xml:space="preserve">
|
||||
<value>Enter the database server</value>
|
||||
<value>Enter the database server name. This might include a port number as well if you are using a cloud service (ie. servername.database.windows.net,1433) </value>
|
||||
</data>
|
||||
<data name="Database.Text" xml:space="preserve">
|
||||
<value>Database:</value>
|
||||
|
@ -133,7 +133,7 @@
|
|||
<value>Integrated Security:</value>
|
||||
</data>
|
||||
<data name="IntegratedSecurity.HelpText" xml:space="preserve">
|
||||
<value>Select if you want integrated security or not</value>
|
||||
<value>Select if you are using integrated security</value>
|
||||
</data>
|
||||
<data name="Uid.Text" xml:space="preserve">
|
||||
<value>User Id:</value>
|
||||
|
@ -163,7 +163,7 @@
|
|||
<value>Self Signed</value>
|
||||
</data>
|
||||
<data name="TrustServerCertificate.HelpText" xml:space="preserve">
|
||||
<value>Specify the type of certificate you are using for encryption</value>
|
||||
<value>Specify the type of certificate you are using for encryption. Verifiable is equivalent to False. Self Signed is equivalent to True.</value>
|
||||
</data>
|
||||
<data name="TrustServerCertificate.Text" xml:space="preserve">
|
||||
<value>Trust Server Certificate:</value>
|
||||
|
|
|
@ -135,10 +135,10 @@
|
|||
<data name="Message.Require.DbInfo" xml:space="preserve">
|
||||
<value>Please Enter All Required Fields. Ensure Passwords Match And Email Address Provided Is Valid.</value>
|
||||
</data>
|
||||
<data name="Message.Password.Invalid" xml:space="preserve">
|
||||
<data name="Message.Password.Invalid" xml:space="preserve">
|
||||
<value>The Password Provided Does Not Meet The Password Policy. Please Verify The Minimum Password Length And Complexity Requirements.</value>
|
||||
</data>
|
||||
<data name="Register" xml:space="preserve">
|
||||
<data name="Register" xml:space="preserve">
|
||||
<value>Please Register Me For Major Product Updates And Security Bulletins</value>
|
||||
</data>
|
||||
<data name="Confirm.HelpText" xml:space="preserve">
|
||||
|
@ -168,4 +168,16 @@
|
|||
<data name="Username.Text" xml:space="preserve">
|
||||
<value>Username:</value>
|
||||
</data>
|
||||
<data name="ConnectionString.HelpText" xml:space="preserve">
|
||||
<value>Enter a complete connection string including all parameters and delimiters</value>
|
||||
</data>
|
||||
<data name="ConnectionString.Text" xml:space="preserve">
|
||||
<value>String:</value>
|
||||
</data>
|
||||
<data name="EnterConnectionParameters" xml:space="preserve">
|
||||
<value>Enter Connection Parameters</value>
|
||||
</data>
|
||||
<data name="EnterConnectionString" xml:space="preserve">
|
||||
<value>Enter Connection String</value>
|
||||
</data>
|
||||
</root>
|
Loading…
Reference in New Issue
Block a user