|
|
|
@ -1,15 +1,15 @@ |
|
|
|
@page "/tenant-management/tenants" |
|
|
|
@attribute [Authorize(TenantManagementPermissions.Tenants.Default)] |
|
|
|
@attribute [Authorize( TenantManagementPermissions.Tenants.Default )] |
|
|
|
@using Microsoft.AspNetCore.Authorization |
|
|
|
@using Volo.Abp.FeatureManagement.Blazor.Components |
|
|
|
@using Microsoft.AspNetCore.Components.Forms |
|
|
|
|
|
|
|
@using Volo.Abp.TenantManagement.Localization |
|
|
|
@inject AbpBlazorMessageLocalizerHelper<AbpTenantManagementResource> LH |
|
|
|
@inherits AbpCrudPageBase<ITenantAppService, TenantDto, Guid, GetTenantsInput, TenantCreateDto, TenantUpdateDto> |
|
|
|
|
|
|
|
@* ************************* PAGE HEADER ************************* *@ |
|
|
|
<Row> |
|
|
|
<Column ColumnSize="ColumnSize.Is6"> |
|
|
|
<h1>@L["Tenants"]</h1> |
|
|
|
<Heading Size="HeadingSize.Is1">@L["Tenants"]</Heading> |
|
|
|
</Column> |
|
|
|
<Column ColumnSize="ColumnSize.Is6"> |
|
|
|
@if (HasCreatePermission) |
|
|
|
@ -65,31 +65,52 @@ |
|
|
|
{ |
|
|
|
<Modal @ref="CreateModal"> |
|
|
|
<ModalBackdrop /> |
|
|
|
<ModalContent IsCentered="true"> |
|
|
|
<ModalHeader> |
|
|
|
<ModalTitle>@L["NewTenant"]</ModalTitle> |
|
|
|
<CloseButton Clicked="CloseCreateModalAsync" /> |
|
|
|
</ModalHeader> |
|
|
|
<ModalBody> |
|
|
|
<EditForm id="TenantCreateForm" Model="@NewEntity" OnValidSubmit="CreateEntityAsync"> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["TenantName"]</FieldLabel> |
|
|
|
<TextEdit @bind-text="@NewEntity.Name" /> |
|
|
|
</Field> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:AdminEmailAddress"]</FieldLabel> |
|
|
|
<TextEdit Role="@TextRole.Email" @bind-text="@NewEntity.AdminEmailAddress" /> |
|
|
|
</Field> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:AdminPassword"]</FieldLabel> |
|
|
|
<TextEdit Role="@TextRole.Password" @bind-text="@NewEntity.AdminPassword" /> |
|
|
|
</Field> |
|
|
|
</EditForm> |
|
|
|
</ModalBody> |
|
|
|
<ModalFooter> |
|
|
|
<Button Color="Color.Secondary" Clicked="CloseCreateModalAsync">@L["Cancel"]</Button> |
|
|
|
<Button form="TenantCreateForm" Color="Color.Primary" Clicked="CreateEntityAsync">@L["Save"]</Button> |
|
|
|
</ModalFooter> |
|
|
|
<ModalContent Centered="true"> |
|
|
|
<Form id="TenantCreateForm"> |
|
|
|
<ModalHeader> |
|
|
|
<ModalTitle>@L["NewTenant"]</ModalTitle> |
|
|
|
<CloseButton Clicked="CloseCreateModalAsync" /> |
|
|
|
</ModalHeader> |
|
|
|
<ModalBody> |
|
|
|
|
|
|
|
<Validations @ref="@CreateValidationsRef" Model="@NewEntity" ValidateOnLoad="false"> |
|
|
|
<Validation MessageLocalizer="@LH.Localize"> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["TenantName"]</FieldLabel> |
|
|
|
<TextEdit @bind-Text="@NewEntity.Name"> |
|
|
|
<Feedback> |
|
|
|
<ValidationError /> |
|
|
|
</Feedback> |
|
|
|
</TextEdit> |
|
|
|
</Field> |
|
|
|
</Validation> |
|
|
|
<Validation MessageLocalizer="@LH.Localize"> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:AdminEmailAddress"]</FieldLabel> |
|
|
|
<TextEdit Role="@TextRole.Email" @bind-Text="@NewEntity.AdminEmailAddress"> |
|
|
|
<Feedback> |
|
|
|
<ValidationError /> |
|
|
|
</Feedback> |
|
|
|
</TextEdit> |
|
|
|
</Field> |
|
|
|
</Validation> |
|
|
|
<Validation MessageLocalizer="@LH.Localize"> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:AdminPassword"]</FieldLabel> |
|
|
|
<TextEdit Role="@TextRole.Password" @bind-Text="@NewEntity.AdminPassword"> |
|
|
|
<Feedback> |
|
|
|
<ValidationError /> |
|
|
|
</Feedback> |
|
|
|
</TextEdit> |
|
|
|
</Field> |
|
|
|
</Validation> |
|
|
|
</Validations> |
|
|
|
</ModalBody> |
|
|
|
<ModalFooter> |
|
|
|
<Button Color="Color.Secondary" Clicked="CloseCreateModalAsync">@L["Cancel"]</Button> |
|
|
|
<Button form="TenantCreateForm" Type="ButtonType.Submit" PreventDefaultOnSubmit="true" Color="Color.Primary" Clicked="CreateEntityAsync">@L["Save"]</Button> |
|
|
|
</ModalFooter> |
|
|
|
</Form> |
|
|
|
</ModalContent> |
|
|
|
</Modal> |
|
|
|
} |
|
|
|
@ -99,23 +120,31 @@ |
|
|
|
{ |
|
|
|
<Modal @ref="EditModal"> |
|
|
|
<ModalBackdrop /> |
|
|
|
<ModalContent IsCentered="true"> |
|
|
|
<ModalHeader> |
|
|
|
<ModalTitle>@L["Edit"]</ModalTitle> |
|
|
|
<CloseButton Clicked="CloseEditModalAsync" /> |
|
|
|
</ModalHeader> |
|
|
|
<ModalBody> |
|
|
|
<EditForm id="TenantEditForm" Model="@EditingEntity" OnValidSubmit="UpdateEntityAsync"> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["TenantName"]</FieldLabel> |
|
|
|
<TextEdit @bind-text="@EditingEntity.Name" /> |
|
|
|
</Field> |
|
|
|
</EditForm> |
|
|
|
</ModalBody> |
|
|
|
<ModalFooter> |
|
|
|
<Button Color="Color.Secondary" Clicked="CloseEditModalAsync">@L["Cancel"]</Button> |
|
|
|
<Button form="TenantEditForm" Color="Color.Primary" Clicked="UpdateEntityAsync">@L["Save"]</Button> |
|
|
|
</ModalFooter> |
|
|
|
<ModalContent Centered="true"> |
|
|
|
<Form id="TenantEditForm"> |
|
|
|
<ModalHeader> |
|
|
|
<ModalTitle>@L["Edit"]</ModalTitle> |
|
|
|
<CloseButton Clicked="CloseEditModalAsync" /> |
|
|
|
</ModalHeader> |
|
|
|
<ModalBody> |
|
|
|
<Validations @ref="@EditValidationsRef" Model="@EditingEntity" ValidateOnLoad="false"> |
|
|
|
<Validation MessageLocalizer="@LH.Localize"> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["TenantName"]</FieldLabel> |
|
|
|
<TextEdit @bind-Text="@EditingEntity.Name"> |
|
|
|
<Feedback> |
|
|
|
<ValidationError /> |
|
|
|
</Feedback> |
|
|
|
</TextEdit> |
|
|
|
</Field> |
|
|
|
</Validation> |
|
|
|
</Validations> |
|
|
|
</ModalBody> |
|
|
|
<ModalFooter> |
|
|
|
<Button Color="Color.Secondary" Clicked="CloseEditModalAsync">@L["Cancel"]</Button> |
|
|
|
<Button form="TenantEditForm" Type="ButtonType.Submit" PreventDefaultOnSubmit="true" Color="Color.Primary" Clicked="UpdateEntityAsync">@L["Save"]</Button> |
|
|
|
</ModalFooter> |
|
|
|
</Form> |
|
|
|
</ModalContent> |
|
|
|
</Modal> |
|
|
|
} |
|
|
|
@ -125,30 +154,36 @@ |
|
|
|
{ |
|
|
|
<Modal @ref="@ManageConnectionStringModal"> |
|
|
|
<ModalBackdrop /> |
|
|
|
<ModalContent IsCentered="true"> |
|
|
|
<ModalHeader> |
|
|
|
<ModalTitle>@L["ConnectionStrings"]</ModalTitle> |
|
|
|
<CloseButton Clicked="CloseEditConnectionStringModal" /> |
|
|
|
</ModalHeader> |
|
|
|
<ModalBody> |
|
|
|
<EditForm id="ConnectionStringEditForm" Model="@TenantInfo" OnValidSubmit="UpdateConnectionStringAsync"> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:DefaultConnectionString"]</FieldLabel> |
|
|
|
<Check TValue="bool" @bind-Checked="@TenantInfo.UseSharedDatabase" Cursor="@Cursor.Pointer" /> |
|
|
|
</Field> |
|
|
|
@if (!TenantInfo.UseSharedDatabase) |
|
|
|
{ |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:DefaultConnectionString"]</FieldLabel> |
|
|
|
<TextEdit @bind-text="@TenantInfo.DefaultConnectionString" /> |
|
|
|
</Field> |
|
|
|
} |
|
|
|
</EditForm> |
|
|
|
</ModalBody> |
|
|
|
<ModalFooter> |
|
|
|
<Button Color="Color.Secondary" Clicked="CloseEditConnectionStringModal">@L["Cancel"]</Button> |
|
|
|
<Button form="ConnectionStringEditForm" Color="Color.Primary" Clicked="UpdateConnectionStringAsync">@L["Save"]</Button> |
|
|
|
</ModalFooter> |
|
|
|
<ModalContent Centered="true"> |
|
|
|
<Form id="ConnectionStringEditForm"> |
|
|
|
<ModalHeader> |
|
|
|
<ModalTitle>@L["ConnectionStrings"]</ModalTitle> |
|
|
|
<CloseButton Clicked="CloseEditConnectionStringModal" /> |
|
|
|
</ModalHeader> |
|
|
|
<ModalBody> |
|
|
|
<Validations @ref="@ManageConnectionStringValidations" Model="@TenantInfo" ValidateOnLoad="false"> |
|
|
|
<Validation MessageLocalizer="@LH.Localize"> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:DefaultConnectionString"]</FieldLabel> |
|
|
|
<Check TValue="bool" @bind-Checked="@TenantInfo.UseSharedDatabase" Cursor="@Cursor.Pointer" /> |
|
|
|
</Field> |
|
|
|
</Validation> |
|
|
|
@if (!TenantInfo.UseSharedDatabase) |
|
|
|
{ |
|
|
|
<Validation MessageLocalizer="@LH.Localize"> |
|
|
|
<Field> |
|
|
|
<FieldLabel>@L["DisplayName:DefaultConnectionString"]</FieldLabel> |
|
|
|
<TextEdit @bind-Text="@TenantInfo.DefaultConnectionString" /> |
|
|
|
</Field> |
|
|
|
</Validation> |
|
|
|
} |
|
|
|
</Validations> |
|
|
|
</ModalBody> |
|
|
|
<ModalFooter> |
|
|
|
<Button Color="Color.Secondary" Clicked="CloseEditConnectionStringModal">@L["Cancel"]</Button> |
|
|
|
<Button form="ConnectionStringEditForm" Type="ButtonType.Submit" PreventDefaultOnSubmit="true" Color="Color.Primary" Clicked="UpdateConnectionStringAsync">@L["Save"]</Button> |
|
|
|
</ModalFooter> |
|
|
|
</Form> |
|
|
|
</ModalContent> |
|
|
|
</Modal> |
|
|
|
} |
|
|
|
|