Merge pull request #2516 from sbwalker/dev
hide connection string by default in SQL Management and provide toggle for display
This commit is contained in:
commit
f671af43cd
|
@ -38,9 +38,12 @@ else
|
|||
<div class="row mb-1 align-items-center">
|
||||
<Label Class="col-sm-3" For="connectionstring" HelpText="The connection information for the database" ResourceKey="ConnectionString">Connection: </Label>
|
||||
<div class="col-sm-9">
|
||||
<textarea id="connectionstring" class="form-control" @bind="@_connectionstring" rows="2" readonly></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<input id="connectionstring" type="@_connectionstringtype" class="form-control" @bind="@_connectionstring" readonly />
|
||||
<button type="button" class="btn btn-secondary" @onclick="@ToggleConnectionString">@_connectionstringtoggle</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-1 align-items-center">
|
||||
<Label Class="col-sm-3" For="sqlQeury" HelpText="Enter the query for the SQL server" ResourceKey="SqlQuery">SQL Query: </Label>
|
||||
<div class="col-sm-9">
|
||||
|
@ -85,8 +88,10 @@ else
|
|||
private List<Tenant> _tenants;
|
||||
private string _tenantid = "-1";
|
||||
private string _database = string.Empty;
|
||||
private string _connectionstring = string.Empty;
|
||||
private string _sql = string.Empty;
|
||||
private string _connectionstring = string.Empty;
|
||||
private string _connectionstringtype = "password";
|
||||
private string _connectionstringtoggle = string.Empty;
|
||||
private string _sql = string.Empty;
|
||||
private List<Dictionary<string, string>> _results;
|
||||
|
||||
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
|
||||
|
@ -96,7 +101,8 @@ else
|
|||
try
|
||||
{
|
||||
_tenants = await TenantService.GetTenantsAsync();
|
||||
}
|
||||
_connectionstringtoggle = SharedLocalizer["ShowPassword"];
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
await logger.LogError(ex, "Error Loading Tenants {Error}", ex.Message);
|
||||
|
@ -126,7 +132,21 @@ else
|
|||
}
|
||||
}
|
||||
|
||||
private async Task Execute()
|
||||
private void ToggleConnectionString()
|
||||
{
|
||||
if (_connectionstringtype == "password")
|
||||
{
|
||||
_connectionstringtype = "text";
|
||||
_connectionstringtoggle = SharedLocalizer["HidePassword"];
|
||||
}
|
||||
else
|
||||
{
|
||||
_connectionstringtype = "password";
|
||||
_connectionstringtoggle = SharedLocalizer["ShowPassword"];
|
||||
}
|
||||
}
|
||||
|
||||
private async Task Execute()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user