mirror of https://github.com/abpframework/abp.git
1 changed files with 152 additions and 11 deletions
@ -1,14 +1,155 @@ |
|||||
@page "/identity/users" |
@page "/identity/users" |
||||
|
@attribute [Authorize] |
||||
|
@using Microsoft.AspNetCore.Authorization |
||||
|
@using Microsoft.Extensions.Localization |
||||
|
@using Volo.Abp.Application.Dtos |
||||
|
@using Volo.Abp.Identity.Localization |
||||
@inherits BlazorisePageBase<IIdentityUserAppService, IdentityUserDto, Guid, GetIdentityUsersInput, IdentityUserCreateDto, IdentityUserUpdateDto> |
@inherits BlazorisePageBase<IIdentityUserAppService, IdentityUserDto, Guid, GetIdentityUsersInput, IdentityUserCreateDto, IdentityUserUpdateDto> |
||||
|
@inject IStringLocalizer<IdentityResource> L |
||||
|
|
||||
<h3>UserManagement</h3> |
@* ************************* PAGE HEADER ************************* *@ |
||||
|
<Row> |
||||
@if (Entities != null) |
<Column ColumnSize="ColumnSize.Is6"> |
||||
{ |
<h1>@L["Users"]</h1> |
||||
<ul> |
</Column> |
||||
@foreach (var user in Entities) |
<Column ColumnSize="ColumnSize.Is6"> |
||||
{ |
<Paragraph Alignment="TextAlignment.Right"> |
||||
<li>@user.UserName</li> |
<Button Color="Color.Primary" Clicked="OpenCreateModal">@L["NewUser"]</Button> |
||||
} |
</Paragraph> |
||||
</ul> |
</Column> |
||||
} |
</Row> |
||||
|
|
||||
|
@* ************************* DATA GRID ************************* *@ |
||||
|
<DataGrid TItem="IdentityUserDto" |
||||
|
Data="Entities" |
||||
|
ReadData="OnDataGridReadAsync" |
||||
|
TotalItems="TotalCount" |
||||
|
ShowPager="true" |
||||
|
PageSize="@LimitedResultRequestDto.DefaultMaxResultCount"> |
||||
|
<DataGridColumns> |
||||
|
<DataGridColumn Width="150px" TItem="IdentityUserDto" Field="@nameof(IdentityUserDto.UserName)" Sortable="false" Caption="@L["Actions"].Value"> |
||||
|
<DisplayTemplate> |
||||
|
<Dropdown> |
||||
|
<DropdownToggle Color="Color.Primary"> |
||||
|
@L["Actions"] |
||||
|
</DropdownToggle> |
||||
|
<DropdownMenu> |
||||
|
<DropdownItem Clicked="() => OpenEditModalAsync(context.As<IdentityUserDto>().Id)">@L["Edit"]</DropdownItem> |
||||
|
<DropdownDivider/> |
||||
|
<DropdownItem Clicked="() => DeleteEntityAsync(context.As<IdentityUserDto>())">@L["Delete"]</DropdownItem> |
||||
|
</DropdownMenu> |
||||
|
</Dropdown> |
||||
|
</DisplayTemplate> |
||||
|
</DataGridColumn> |
||||
|
<DataGridColumn TItem="IdentityUserDto" Field="@nameof(IdentityUserDto.UserName)" Caption="@L["UserName"].Value"> |
||||
|
<DisplayTemplate> |
||||
|
@(context.As<IdentityUserDto>().UserName) |
||||
|
</DisplayTemplate> |
||||
|
</DataGridColumn> |
||||
|
<DataGridColumn TItem="IdentityUserDto" Field="@nameof(IdentityUserDto.Email)" Caption="@L["Email"].Value"> |
||||
|
<DisplayTemplate> |
||||
|
@(context.As<IdentityUserDto>().Email) |
||||
|
</DisplayTemplate> |
||||
|
</DataGridColumn> |
||||
|
<DataGridColumn TItem="IdentityUserDto" Field="@nameof(IdentityUserDto.PhoneNumber)" Caption="@L["PhoneNumber"].Value"> |
||||
|
<DisplayTemplate> |
||||
|
@(context.As<IdentityUserDto>().PhoneNumber) |
||||
|
</DisplayTemplate> |
||||
|
</DataGridColumn> |
||||
|
</DataGridColumns> |
||||
|
</DataGrid> |
||||
|
|
||||
|
@* ************************* CREATE MODAL ************************* *@ |
||||
|
<Modal @ref="CreateModal"> |
||||
|
<ModalBackdrop /> |
||||
|
<ModalContent IsCentered="true"> |
||||
|
<ModalHeader> |
||||
|
<ModalTitle>@L["NewUser"]</ModalTitle> |
||||
|
<CloseButton Clicked="CloseCreateModal" /> |
||||
|
</ModalHeader> |
||||
|
<ModalBody> |
||||
|
<Field> |
||||
|
<FieldLabel>@L["DisplayName:UserName"]</FieldLabel> |
||||
|
<TextEdit @bind-text="NewEntity.UserName" /> |
||||
|
</Field> |
||||
|
<Field> |
||||
|
<FieldLabel>@L["DisplayName:Name"]</FieldLabel> |
||||
|
<TextEdit @bind-text="NewEntity.Name" /> |
||||
|
</Field> |
||||
|
<Field> |
||||
|
<FieldLabel>@L["DisplayName:Surname"]</FieldLabel> |
||||
|
<TextEdit @bind-text="NewEntity.Surname" /> |
||||
|
</Field> |
||||
|
<Field> |
||||
|
<FieldLabel>@L["DisplayName:Password"]</FieldLabel> |
||||
|
<TextEdit @bind-text="NewEntity.Password" /> |
||||
|
</Field> |
||||
|
<Field> |
||||
|
<FieldLabel>@L["DisplayName:Email"]</FieldLabel> |
||||
|
<TextEdit @bind-text="NewEntity.Email" /> |
||||
|
</Field> |
||||
|
<Field> |
||||
|
<FieldLabel>@L["DisplayName:PhoneNumber"]</FieldLabel> |
||||
|
<TextEdit @bind-text="NewEntity.PhoneNumber" /> |
||||
|
</Field> |
||||
|
<Field> |
||||
|
<Check TValue="bool" @bind-checked="NewEntity.LockoutEnabled">@L["DisplayName:LockoutEnabled"]</Check> |
||||
|
</Field> |
||||
|
<Field> |
||||
|
<Check TValue="bool" @bind-checked="NewEntity.TwoFactorEnabled">@L["DisplayName:TwoFactorEnabled"]</Check> |
||||
|
</Field> |
||||
|
</ModalBody> |
||||
|
<ModalFooter> |
||||
|
<Button Color="Color.Secondary" Clicked="CloseCreateModal">@L["Cancel"]</Button> |
||||
|
<Button Color="Color.Primary" Clicked="CreateEntityAsync">@L["Save"]</Button> |
||||
|
</ModalFooter> |
||||
|
</ModalContent> |
||||
|
</Modal> |
||||
|
|
||||
|
@* ************************* EDIT MODAL ************************* *@ |
||||
|
<Modal @ref="EditModal"> |
||||
|
<ModalBackdrop /> |
||||
|
<ModalContent IsCentered="true"> |
||||
|
<ModalHeader> |
||||
|
<ModalTitle>role</ModalTitle> |
||||
|
<CloseButton Clicked="CloseEditModal" /> |
||||
|
</ModalHeader> |
||||
|
<ModalBody> |
||||
|
<input type="hidden" name="ConcurrencyStamp" @bind-value="EditingEntity.ConcurrencyStamp" /> |
||||
|
<Field> |
||||
|
<FieldLabel>@L["DisplayName:UserName"]</FieldLabel> |
||||
|
<TextEdit @bind-text="EditingEntity.UserName" /> |
||||
|
</Field> |
||||
|
<Field> |
||||
|
<FieldLabel>@L["DisplayName:Name"]</FieldLabel> |
||||
|
<TextEdit @bind-text="EditingEntity.Name" /> |
||||
|
</Field> |
||||
|
<Field> |
||||
|
<FieldLabel>@L["DisplayName:Surname"]</FieldLabel> |
||||
|
<TextEdit @bind-text="EditingEntity.Surname" /> |
||||
|
</Field> |
||||
|
<Field> |
||||
|
<FieldLabel>@L["DisplayName:Password"]</FieldLabel> |
||||
|
<TextEdit @bind-text="EditingEntity.Password" /> |
||||
|
</Field> |
||||
|
<Field> |
||||
|
<FieldLabel>@L["DisplayName:Email"]</FieldLabel> |
||||
|
<TextEdit @bind-text="EditingEntity.Email" /> |
||||
|
</Field> |
||||
|
<Field> |
||||
|
<FieldLabel>@L["DisplayName:PhoneNumber"]</FieldLabel> |
||||
|
<TextEdit @bind-text="EditingEntity.PhoneNumber" /> |
||||
|
</Field> |
||||
|
<Field> |
||||
|
<Check TValue="bool" @bind-checked="EditingEntity.LockoutEnabled">@L["DisplayName:LockoutEnabled"]</Check> |
||||
|
</Field> |
||||
|
<Field> |
||||
|
<Check TValue="bool" @bind-checked="EditingEntity.TwoFactorEnabled">@L["DisplayName:TwoFactorEnabled"]</Check> |
||||
|
</Field> |
||||
|
</ModalBody> |
||||
|
<ModalFooter> |
||||
|
<Button Color="Color.Secondary" Clicked="CloseEditModal">@L["Cancel"]</Button> |
||||
|
<Button Color="Color.Primary" Clicked="UpdateEntityAsync">@L["Save"]</Button> |
||||
|
</ModalFooter> |
||||
|
</ModalContent> |
||||
|
</Modal> |
||||
Loading…
Reference in new issue