|
|
|
@ -1,64 +1,32 @@ |
|
|
|
@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 |
|
|
|
@using Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Layout |
|
|
|
@using Volo.Abp.BlazoriseUI.Components.ObjectExtending |
|
|
|
@inject AbpBlazorMessageLocalizerHelper<AbpTenantManagementResource> LH |
|
|
|
@inherits AbpCrudPageBase<ITenantAppService, TenantDto, Guid, GetTenantsInput, TenantCreateDto, TenantUpdateDto> |
|
|
|
|
|
|
|
<Card> |
|
|
|
<CardHeader> |
|
|
|
@* ************************* PAGE HEADER ************************* *@ |
|
|
|
<Row Class="justify-content-between"> |
|
|
|
<Column ColumnSize="ColumnSize.IsAuto"> |
|
|
|
<Heading Size="HeadingSize.Is1">@L["Tenants"]</Heading> |
|
|
|
</Column> |
|
|
|
<Column ColumnSize="ColumnSize.IsAuto"> |
|
|
|
@if (HasCreatePermission) |
|
|
|
{ |
|
|
|
<Button Color="Color.Primary" Clicked="OpenCreateModalAsync"> |
|
|
|
<Icon Margin="Margin.Is1.FromRight" Name="IconName.Add"></Icon>@L["NewTenant"] |
|
|
|
</Button> |
|
|
|
} |
|
|
|
</Column> |
|
|
|
</Row> |
|
|
|
<PageHeader Title="@L["Tenants"]" |
|
|
|
BreadcrumbItems="@BreadcrumbItems" |
|
|
|
Toolbar="@Toolbar"> |
|
|
|
</PageHeader> |
|
|
|
</CardHeader> |
|
|
|
<CardBody> |
|
|
|
@* ************************* DATA GRID ************************* *@ |
|
|
|
<DataGrid TItem="TenantDto" |
|
|
|
Data="Entities" |
|
|
|
ReadData="OnDataGridReadAsync" |
|
|
|
TotalItems="TotalCount" |
|
|
|
ShowPager="true" |
|
|
|
PageSize="PageSize"> |
|
|
|
<DataGridColumns> |
|
|
|
<DataGridEntityActionsColumn TItem="TenantDto" @ref="@EntityActionsColumn"> |
|
|
|
<DisplayTemplate> |
|
|
|
<EntityActions TItem="TenantDto" EntityActionsColumn="@EntityActionsColumn"> |
|
|
|
<EntityAction TItem="TenantDto" |
|
|
|
RequiredPolicy="@UpdatePolicyName" |
|
|
|
Clicked="() => OpenEditModalAsync(context)" |
|
|
|
Text="@L["Edit"]"></EntityAction> |
|
|
|
<EntityAction TItem="TenantDto" |
|
|
|
RequiredPolicy="@ManageFeaturesPolicyName" |
|
|
|
Clicked="() => FeatureManagementModal.OpenAsync(FeatureProviderName, context.Id.ToString())" |
|
|
|
Text="@L["Features"]"></EntityAction> |
|
|
|
<EntityAction TItem="TenantDto" |
|
|
|
RequiredPolicy="@DeletePolicyName" |
|
|
|
Clicked="() => DeleteEntityAsync(context)" |
|
|
|
ConfirmationMessage="()=>GetDeleteConfirmationMessage(context)" |
|
|
|
Text="@L["Delete"]"></EntityAction> |
|
|
|
</EntityActions> |
|
|
|
</DisplayTemplate> |
|
|
|
</DataGridEntityActionsColumn> |
|
|
|
<DataGridColumn TItem="TenantDto" Field="@nameof(TenantDto.Name)" Caption="@L["TenantName"].Value"> |
|
|
|
<DisplayTemplate> |
|
|
|
@(context.Name) |
|
|
|
</DisplayTemplate> |
|
|
|
</DataGridColumn> |
|
|
|
</DataGridColumns> |
|
|
|
</DataGrid> |
|
|
|
<AbpExtensibleDataGrid TItem="TenantDto" |
|
|
|
Data="@Entities" |
|
|
|
ReadData="@OnDataGridReadAsync" |
|
|
|
TotalItems="@TotalCount" |
|
|
|
ShowPager="true" |
|
|
|
PageSize="@PageSize" |
|
|
|
Columns="@TenantManagementTableColumns"> |
|
|
|
</AbpExtensibleDataGrid> |
|
|
|
</CardBody> |
|
|
|
</Card> |
|
|
|
|
|
|
|
@ -66,12 +34,12 @@ |
|
|
|
@if (HasCreatePermission) |
|
|
|
{ |
|
|
|
<Modal @ref="CreateModal"> |
|
|
|
<ModalBackdrop /> |
|
|
|
<ModalBackdrop/> |
|
|
|
<ModalContent Centered="true"> |
|
|
|
<Form> |
|
|
|
<ModalHeader> |
|
|
|
<ModalTitle>@L["NewTenant"]</ModalTitle> |
|
|
|
<CloseButton Clicked="CloseCreateModalAsync" /> |
|
|
|
<CloseButton Clicked="CloseCreateModalAsync"/> |
|
|
|
</ModalHeader> |
|
|
|
<ModalBody> |
|
|
|
<Validations @ref="@CreateValidationsRef" Model="@NewEntity" ValidateOnLoad="false"> |
|
|
|
@ -80,7 +48,7 @@ |
|
|
|
<FieldLabel>@L["TenantName"]</FieldLabel> |
|
|
|
<TextEdit @bind-Text="@NewEntity.Name" Autofocus="true"> |
|
|
|
<Feedback> |
|
|
|
<ValidationError /> |
|
|
|
<ValidationError/> |
|
|
|
</Feedback> |
|
|
|
</TextEdit> |
|
|
|
</Field> |
|
|
|
@ -90,7 +58,7 @@ |
|
|
|
<FieldLabel>@L["DisplayName:AdminEmailAddress"]</FieldLabel> |
|
|
|
<TextEdit Role="@TextRole.Email" @bind-Text="@NewEntity.AdminEmailAddress"> |
|
|
|
<Feedback> |
|
|
|
<ValidationError /> |
|
|
|
<ValidationError/> |
|
|
|
</Feedback> |
|
|
|
</TextEdit> |
|
|
|
</Field> |
|
|
|
@ -100,16 +68,17 @@ |
|
|
|
<FieldLabel>@L["DisplayName:AdminPassword"]</FieldLabel> |
|
|
|
<TextEdit Role="@TextRole.Password" @bind-Text="@NewEntity.AdminPassword"> |
|
|
|
<Feedback> |
|
|
|
<ValidationError /> |
|
|
|
<ValidationError/> |
|
|
|
</Feedback> |
|
|
|
</TextEdit> |
|
|
|
</Field> |
|
|
|
</Validation> |
|
|
|
<ExtensionProperties TEntityType="TenantCreateDto" TResourceType="AbpTenantManagementResource" Entity="@NewEntity" LH="@LH"/> |
|
|
|
</Validations> |
|
|
|
</ModalBody> |
|
|
|
<ModalFooter> |
|
|
|
<Button Color="Color.Secondary" Clicked="CloseCreateModalAsync">@L["Cancel"]</Button> |
|
|
|
<SubmitButton Clicked="@CreateEntityAsync" /> |
|
|
|
<SubmitButton Clicked="@CreateEntityAsync"/> |
|
|
|
</ModalFooter> |
|
|
|
</Form> |
|
|
|
</ModalContent> |
|
|
|
@ -120,12 +89,12 @@ |
|
|
|
@if (HasUpdatePermission) |
|
|
|
{ |
|
|
|
<Modal @ref="EditModal"> |
|
|
|
<ModalBackdrop /> |
|
|
|
<ModalBackdrop/> |
|
|
|
<ModalContent Centered="true"> |
|
|
|
<Form> |
|
|
|
<ModalHeader> |
|
|
|
<ModalTitle>@L["Edit"]</ModalTitle> |
|
|
|
<CloseButton Clicked="CloseEditModalAsync" /> |
|
|
|
<CloseButton Clicked="CloseEditModalAsync"/> |
|
|
|
</ModalHeader> |
|
|
|
<ModalBody> |
|
|
|
<Validations @ref="@EditValidationsRef" Model="@EditingEntity" ValidateOnLoad="false"> |
|
|
|
@ -134,16 +103,17 @@ |
|
|
|
<FieldLabel>@L["TenantName"]</FieldLabel> |
|
|
|
<TextEdit @bind-Text="@EditingEntity.Name" Autofocus="true"> |
|
|
|
<Feedback> |
|
|
|
<ValidationError /> |
|
|
|
<ValidationError/> |
|
|
|
</Feedback> |
|
|
|
</TextEdit> |
|
|
|
</Field> |
|
|
|
</Validation> |
|
|
|
</Validations> |
|
|
|
<ExtensionProperties TEntityType="TenantUpdateDto" TResourceType="AbpTenantManagementResource" Entity="@EditingEntity" LH="@LH"/> |
|
|
|
</ModalBody> |
|
|
|
<ModalFooter> |
|
|
|
<Button Color="Color.Secondary" Clicked="CloseEditModalAsync">@L["Cancel"]</Button> |
|
|
|
<SubmitButton Clicked="@UpdateEntityAsync" /> |
|
|
|
<SubmitButton Clicked="@UpdateEntityAsync"/> |
|
|
|
</ModalFooter> |
|
|
|
</Form> |
|
|
|
</ModalContent> |
|
|
|
@ -152,5 +122,5 @@ |
|
|
|
|
|
|
|
@if (HasManageFeaturesPermission) |
|
|
|
{ |
|
|
|
<FeatureManagementModal @ref="FeatureManagementModal" /> |
|
|
|
} |
|
|
|
<FeatureManagementModal @ref="FeatureManagementModal"/> |
|
|
|
} |