Merge pull request #899 from hishamco/localize-sql-page
Localize SQL Page
This commit is contained in:
commit
ab5bf3cda5
|
@ -1,8 +1,9 @@
|
|||
@namespace Oqtane.Modules.Admin.Sql
|
||||
@namespace Oqtane.Modules.Admin.Sql
|
||||
@inherits ModuleBase
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject ITenantService TenantService
|
||||
@inject ISqlService SqlService
|
||||
@inject IStringLocalizer<Index> Localizer
|
||||
|
||||
@if (_tenants == null)
|
||||
{
|
||||
|
@ -13,11 +14,11 @@ else
|
|||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<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>
|
||||
<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)
|
||||
{
|
||||
<option value="@tenant.TenantId">@tenant.Name</option>
|
||||
|
@ -27,15 +28,16 @@ else
|
|||
</tr>
|
||||
<tr>
|
||||
<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>
|
||||
<textarea id="sqlQeury" class="form-control" @bind="@_sql" rows="5"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<button type="button" class="btn btn-success" @onclick="Execute">Execute</button>
|
||||
<br /><br />
|
||||
<button type="button" class="btn btn-success" @onclick="Execute">@Localizer["Execute"]</button>
|
||||
<br />
|
||||
<br />
|
||||
@if (!string.IsNullOrEmpty(_results))
|
||||
{
|
||||
@((MarkupString)_results)
|
||||
|
@ -78,25 +80,25 @@ else
|
|||
{
|
||||
table = "<div class=\"table-responsive\">";
|
||||
table += "<table class=\"table table-bordered\"><thead><tr>";
|
||||
|
||||
|
||||
foreach (KeyValuePair<string, string> kvp in item)
|
||||
{
|
||||
table += "<th scope=\"col\">" + kvp.Key + "</th>";
|
||||
}
|
||||
|
||||
|
||||
table += "</tr></thead><tbody>";
|
||||
}
|
||||
|
||||
|
||||
table += "<tr>";
|
||||
|
||||
|
||||
foreach (KeyValuePair<string, string> kvp in item)
|
||||
{
|
||||
table += "<td>" + kvp.Value + "</td>";
|
||||
}
|
||||
|
||||
|
||||
table += "</tr>";
|
||||
}
|
||||
|
||||
|
||||
if (table != string.Empty)
|
||||
{
|
||||
table += "</tbody></table></div>";
|
||||
|
@ -105,7 +107,7 @@ else
|
|||
{
|
||||
table = "No Results Returned";
|
||||
}
|
||||
|
||||
|
||||
return table;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user