Merge pull request #897 from hishamco/localize-tenants-pages
Localize Tenants Pages
This commit is contained in:
commit
4a8dd2dc6a
|
@ -1,12 +1,13 @@
|
|||
@namespace Oqtane.Modules.Admin.Tenants
|
||||
@namespace Oqtane.Modules.Admin.Tenants
|
||||
@inherits ModuleBase
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject ITenantService TenantService
|
||||
@inject IStringLocalizer<Edit> Localizer
|
||||
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="name" HelpText="The name of the tenant">Name: </Label>
|
||||
<Label For="name" HelpText="The name of the tenant" ResourceKey="Name">Name: </Label>
|
||||
</td>
|
||||
<td>
|
||||
@if (name == TenantNames.Master)
|
||||
|
@ -21,7 +22,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="connectionstring" HelpText="The database connection string">Connection String: </Label>
|
||||
<Label For="connectionstring" HelpText="The database connection string" ResourceKey="ConnectionString">Connection String: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<textarea id="connectionstring" class="form-control" @bind="@connectionstring" rows="3" readonly></textarea>
|
||||
|
@ -29,8 +30,8 @@
|
|||
</tr>
|
||||
|
||||
</table>
|
||||
<button type="button" class="btn btn-success" @onclick="SaveTenant">Save</button>
|
||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||
<button type="button" class="btn btn-success" @onclick="SaveTenant">@Localizer["Save"]</button>
|
||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
|
||||
|
||||
@code {
|
||||
private int tenantid;
|
||||
|
@ -69,7 +70,7 @@
|
|||
{
|
||||
tenant.Name = name;
|
||||
tenant.DBConnectionString = connectionstring;
|
||||
|
||||
|
||||
await TenantService.UpdateTenantAsync(tenant);
|
||||
await logger.LogInformation("Tenant Saved {TenantId}", tenantid);
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
@namespace Oqtane.Modules.Admin.Tenants
|
||||
@namespace Oqtane.Modules.Admin.Tenants
|
||||
@inherits ModuleBase
|
||||
@inject ITenantService TenantService
|
||||
@inject IAliasService AliasService
|
||||
@inject IStringLocalizer<Index> Localizer
|
||||
|
||||
@if (tenants == null)
|
||||
{
|
||||
<p><em>Loading...</em></p>
|
||||
<p><em>@Localizer["Loading..."]</em></p>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -13,11 +14,11 @@ else
|
|||
<Header>
|
||||
<th style="width: 1px;"> </th>
|
||||
<th style="width: 1px;"> </th>
|
||||
<th>Name</th>
|
||||
<th>@Localizer["Name"]</th>
|
||||
</Header>
|
||||
<Row>
|
||||
<td><ActionLink Action="Edit" Parameters="@($"id=" + context.TenantId.ToString())" /></td>
|
||||
<td><ActionDialog Header="Delete Tenant" Message="@("Are You Sure You Wish To Delete The " + context.Name + " Tenant?")" Action="Delete" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await DeleteTenant(context))" Disabled="@(context.Name == TenantNames.Master)" /></td>
|
||||
<td><ActionLink Action="Edit" Parameters="@($"id=" + context.TenantId.ToString())" ResourceKey="EditTenant" /></td>
|
||||
<td><ActionDialog Header="Delete Tenant" Message="@("Are You Sure You Wish To Delete The " + context.Name + " Tenant?")" Action="Delete" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await DeleteTenant(context))" Disabled="@(context.Name == TenantNames.Master)" ResourceKey="DeleteTenant" /></td>
|
||||
<td>@context.Name</td>
|
||||
</Row>
|
||||
</Pager>
|
||||
|
|
Loading…
Reference in New Issue
Block a user