Localize SQL page
This commit is contained in:
parent
2b371b2a9f
commit
1518afbd93
|
@ -1,8 +1,9 @@
|
||||||
@namespace Oqtane.Modules.Admin.Sql
|
@namespace Oqtane.Modules.Admin.Sql
|
||||||
@inherits ModuleBase
|
@inherits ModuleBase
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
@inject ITenantService TenantService
|
@inject ITenantService TenantService
|
||||||
@inject ISqlService SqlService
|
@inject ISqlService SqlService
|
||||||
|
@inject IStringLocalizer<Index> Localizer
|
||||||
|
|
||||||
@if (_tenants == null)
|
@if (_tenants == null)
|
||||||
{
|
{
|
||||||
|
@ -13,11 +14,11 @@ else
|
||||||
<table class="table table-borderless">
|
<table class="table table-borderless">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<Label For="tenant" HelpText="Select the tenant for the SQL server">Tenant: </Label>
|
<Label For="tenant" HelpText="Select the tenant for the SQL server" ResourceKey="Tenant">Tenant: </Label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<select id="teneant" class="form-control" @bind="_tenantid">
|
<select id="teneant" class="form-control" @bind="_tenantid">
|
||||||
<option value="-1"><Select Tenant></option>
|
<option value="-1"><@Localizer["Select Tenant"]></option>
|
||||||
@foreach (Tenant tenant in _tenants)
|
@foreach (Tenant tenant in _tenants)
|
||||||
{
|
{
|
||||||
<option value="@tenant.TenantId">@tenant.Name</option>
|
<option value="@tenant.TenantId">@tenant.Name</option>
|
||||||
|
@ -27,15 +28,16 @@ else
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<Label For="sqlQeury" HelpText="Enter the query for the SQL server">SQL Query: </Label>
|
<Label For="sqlQeury" HelpText="Enter the query for the SQL server" ResourceKey="SqlQuery">SQL Query: </Label>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<textarea id="sqlQeury" class="form-control" @bind="@_sql" rows="5"></textarea>
|
<textarea id="sqlQeury" class="form-control" @bind="@_sql" rows="5"></textarea>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<button type="button" class="btn btn-success" @onclick="Execute">Execute</button>
|
<button type="button" class="btn btn-success" @onclick="Execute">@Localizer["Execute"]</button>
|
||||||
<br /><br />
|
<br />
|
||||||
|
<br />
|
||||||
@if (!string.IsNullOrEmpty(_results))
|
@if (!string.IsNullOrEmpty(_results))
|
||||||
{
|
{
|
||||||
@((MarkupString)_results)
|
@((MarkupString)_results)
|
||||||
|
@ -78,25 +80,25 @@ else
|
||||||
{
|
{
|
||||||
table = "<div class=\"table-responsive\">";
|
table = "<div class=\"table-responsive\">";
|
||||||
table += "<table class=\"table table-bordered\"><thead><tr>";
|
table += "<table class=\"table table-bordered\"><thead><tr>";
|
||||||
|
|
||||||
foreach (KeyValuePair<string, string> kvp in item)
|
foreach (KeyValuePair<string, string> kvp in item)
|
||||||
{
|
{
|
||||||
table += "<th scope=\"col\">" + kvp.Key + "</th>";
|
table += "<th scope=\"col\">" + kvp.Key + "</th>";
|
||||||
}
|
}
|
||||||
|
|
||||||
table += "</tr></thead><tbody>";
|
table += "</tr></thead><tbody>";
|
||||||
}
|
}
|
||||||
|
|
||||||
table += "<tr>";
|
table += "<tr>";
|
||||||
|
|
||||||
foreach (KeyValuePair<string, string> kvp in item)
|
foreach (KeyValuePair<string, string> kvp in item)
|
||||||
{
|
{
|
||||||
table += "<td>" + kvp.Value + "</td>";
|
table += "<td>" + kvp.Value + "</td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
table += "</tr>";
|
table += "</tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (table != string.Empty)
|
if (table != string.Empty)
|
||||||
{
|
{
|
||||||
table += "</tbody></table></div>";
|
table += "</tbody></table></div>";
|
||||||
|
@ -105,7 +107,7 @@ else
|
||||||
{
|
{
|
||||||
table = "No Results Returned";
|
table = "No Results Returned";
|
||||||
}
|
}
|
||||||
|
|
||||||
return table;
|
return table;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user