mirror of https://github.com/abpframework/abp.git
csharpabpc-sharpframeworkblazoraspnet-coredotnet-coreaspnetcorearchitecturesaasdomain-driven-designangularmulti-tenancy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
305 lines
18 KiB
305 lines
18 KiB
@page "/identity/users"
|
|
@page "/{culture}/identity/users"
|
|
@attribute [Authorize(IdentityPermissions.Users.Default)]
|
|
@using Microsoft.AspNetCore.Authorization
|
|
@using Volo.Abp.PermissionManagement.Blazor.Components
|
|
@using Volo.Abp.BlazoriseUI.Components.ObjectExtending
|
|
@using Volo.Abp.Identity.Localization
|
|
@using Volo.Abp.AspNetCore.Components.Web.Theming.Layout
|
|
@inject AbpBlazorMessageLocalizerHelper<IdentityResource> LH
|
|
@using Microsoft.Extensions.Localization
|
|
@using Volo.Abp.UI.Navigation.Localization.Resource
|
|
@inject IStringLocalizer<AbpUiNavigationResource> LUiNavigation
|
|
|
|
@inherits AbpCrudPageBase<IIdentityUserAppService, IdentityUserDto, Guid, GetIdentityUsersInput, IdentityUserCreateDto, IdentityUserUpdateDto>
|
|
|
|
<Card>
|
|
<CardHeader>
|
|
@* ************************* PAGE HEADER ************************* *@
|
|
<PageHeader Title="@L["Users"]"
|
|
BreadcrumbItems="@BreadcrumbItems"
|
|
Toolbar="@Toolbar" />
|
|
</CardHeader>
|
|
<CardBody class="row">
|
|
|
|
<Column ColumnSize="ColumnSize.Is8">
|
|
</Column>
|
|
<Column ColumnSize="ColumnSize.Is4" class="form-group row" style="text-align:right;">
|
|
<label for="inputPassword" class="col-sm-4 col-form-label pt-1"> @L["Search"] </label>
|
|
<div class="col-sm-8">
|
|
<TextInput class="form-control-sm" id="inputPassword" Value="@GetListInput.Filter" ValueChanged="@OnSearchTextChanged" />
|
|
</div>
|
|
</Column>
|
|
|
|
@* ************************* DATA GRID ************************* *@
|
|
<AbpExtensibleDataGrid TItem="IdentityUserDto"
|
|
Data="Entities"
|
|
ReadData="OnDataGridReadAsync"
|
|
TotalItems="TotalCount"
|
|
ShowPager="true"
|
|
PageSize="PageSize"
|
|
CurrentPage="@CurrentPage"
|
|
Columns="@UserManagementTableColumns">
|
|
</AbpExtensibleDataGrid>
|
|
</CardBody>
|
|
</Card>
|
|
|
|
@* ************************* CREATE MODAL ************************* *@
|
|
@if (HasCreatePermission)
|
|
{
|
|
<Modal @ref="CreateModal" Closing="@ClosingCreateModal" Centered="true">
|
|
<ModalContent>
|
|
<Form id="CreateUserForm">
|
|
<ModalHeader>
|
|
<ModalTitle>@L["NewUser"]</ModalTitle>
|
|
<CloseButton Clicked="CloseCreateModalAsync" />
|
|
</ModalHeader>
|
|
<ModalBody>
|
|
<Validations @ref="@CreateValidationsRef" Model="@NewEntity" ValidateOnLoad="false">
|
|
<Tabs @bind-SelectedTab="@CreateModalSelectedTab">
|
|
<Items>
|
|
<Tab Name="UserInformations">@L["UserInformations"]</Tab>
|
|
<Tab Name="Roles">@L["Roles"]</Tab>
|
|
</Items>
|
|
<Content>
|
|
<TabPanel Name="UserInformations">
|
|
<Validation MessageLocalizer="@LH.Localize">
|
|
<Field>
|
|
<FieldLabel>@L["DisplayName:UserName"] *</FieldLabel>
|
|
<TextInput @bind-Value="NewEntity.UserName" Autofocus="true">
|
|
<Feedback>
|
|
<ValidationError />
|
|
</Feedback>
|
|
</TextInput>
|
|
</Field>
|
|
</Validation>
|
|
<Validation MessageLocalizer="@LH.Localize">
|
|
<Field>
|
|
<FieldLabel>@L["DisplayName:Name"]</FieldLabel>
|
|
<TextInput @bind-Value="NewEntity.Name">
|
|
<Feedback>
|
|
<ValidationError />
|
|
</Feedback>
|
|
</TextInput>
|
|
</Field>
|
|
</Validation>
|
|
<Validation MessageLocalizer="@LH.Localize">
|
|
<Field>
|
|
<FieldLabel>@L["DisplayName:Surname"]</FieldLabel>
|
|
<TextInput @bind-Value="NewEntity.Surname">
|
|
<Feedback>
|
|
<ValidationError />
|
|
</Feedback>
|
|
</TextInput>
|
|
</Field>
|
|
</Validation>
|
|
<Validation MessageLocalizer="@LH.Localize">
|
|
<Field>
|
|
<FieldLabel>@L["DisplayName:Password"] *</FieldLabel>
|
|
<Addons>
|
|
<Addon AddonType="AddonType.Body">
|
|
<TextInput Role="@_passwordTextRole" @bind-Value="NewEntity.Password">
|
|
</TextInput>
|
|
</Addon>
|
|
<Addon AddonType="AddonType.End">
|
|
<Button Color="Color.Secondary" Clicked="@(() => ChangePasswordTextRole(null))"
|
|
aria-label="@UiLocalizer["ShowPassword"]" aria-pressed="@(ShowPassword ? "true" : "false")">
|
|
<Icon Name="ShowPassword ? IconName.Eye : IconName.EyeSlash" aria-hidden="true" />
|
|
</Button>
|
|
</Addon>
|
|
</Addons>
|
|
<ValidationError Style="display: block" />
|
|
</Field>
|
|
</Validation>
|
|
<Validation MessageLocalizer="@LH.Localize">
|
|
<Field>
|
|
<FieldLabel>@L["DisplayName:Email"] *</FieldLabel>
|
|
<TextInput @bind-Value="NewEntity.Email">
|
|
<Feedback>
|
|
<ValidationError />
|
|
</Feedback>
|
|
</TextInput>
|
|
</Field>
|
|
</Validation>
|
|
<Validation MessageLocalizer="@LH.Localize">
|
|
<Field>
|
|
<FieldLabel>@L["DisplayName:PhoneNumber"]</FieldLabel>
|
|
<TextInput @bind-Value="NewEntity.PhoneNumber">
|
|
<Feedback>
|
|
<ValidationError />
|
|
</Feedback>
|
|
</TextInput>
|
|
</Field>
|
|
</Validation>
|
|
<Field>
|
|
<Check TValue="bool" @bind-Value="@NewEntity.IsActive">@L["DisplayName:IsActive"]</Check>
|
|
</Field>
|
|
<Field>
|
|
<Tooltip Text="@L["Description:LockoutEnabled"].Value" style="width: fit-content;" Placement="TooltipPlacement.Right" >
|
|
<Check TValue="bool" @bind-Value="@NewEntity.LockoutEnabled">@L["DisplayName:LockoutEnabled"] <Icon Name="IconName.InfoCircle"/> </Check>
|
|
</Tooltip>
|
|
</Field>
|
|
<ExtensionProperties TEntityType="IdentityUserCreateDto" TResourceType="IdentityResource" Entity="@NewEntity" LH="@LH" ModalType="ExtensionPropertyModalType.CreateModal" />
|
|
</TabPanel>
|
|
<TabPanel Name="Roles">
|
|
@if (NewUserRoles != null)
|
|
{
|
|
@foreach (var role in NewUserRoles)
|
|
{
|
|
<Field>
|
|
<input type="hidden" @bind-value="@role.Name" />
|
|
<Check TValue="bool" @bind-Value="@role.IsAssigned" Disabled="@(!role.IsAssignable)">@role.Name</Check>
|
|
</Field>
|
|
}
|
|
}
|
|
</TabPanel>
|
|
</Content>
|
|
</Tabs>
|
|
</Validations>
|
|
</ModalBody>
|
|
<ModalFooter>
|
|
<Button Color="Color.Primary" Outline Clicked="CloseCreateModalAsync">@L["Cancel"]</Button>
|
|
<SubmitButton Form="CreateUserForm" Clicked="@CreateEntityAsync" />
|
|
</ModalFooter>
|
|
</Form>
|
|
</ModalContent>
|
|
</Modal>
|
|
}
|
|
|
|
@* ************************* EDIT MODAL ************************* *@
|
|
@if (HasUpdatePermission)
|
|
{
|
|
<Modal @ref="EditModal" Closing="@ClosingEditModal" Centered="true">
|
|
<ModalContent>
|
|
<Form id="EditUserForm">
|
|
<ModalHeader>
|
|
<ModalTitle>@L["Edit"]</ModalTitle>
|
|
<CloseButton Clicked="CloseEditModalAsync" />
|
|
</ModalHeader>
|
|
<ModalBody>
|
|
<Validations @ref="@EditValidationsRef" Model="@EditingEntity" ValidateOnLoad="false">
|
|
<input type="hidden" name="ConcurrencyStamp" @bind-value="EditingEntity.ConcurrencyStamp" />
|
|
|
|
<Tabs @bind-SelectedTab="@EditModalSelectedTab">
|
|
<Items>
|
|
<Tab Name="UserInformations">@L["UserInformations"]</Tab>
|
|
@if (EditUserRoles != null && EditUserRoles.Any())
|
|
{
|
|
<Tab Name="Roles">@L["Roles"]</Tab>
|
|
}
|
|
</Items>
|
|
<Content>
|
|
<TabPanel Name="UserInformations">
|
|
<Validation MessageLocalizer="@LH.Localize">
|
|
<Field>
|
|
<FieldLabel>@L["DisplayName:UserName"] *</FieldLabel>
|
|
<TextInput @bind-Value="EditingEntity.UserName" Autofocus="true">
|
|
<Feedback>
|
|
<ValidationError />
|
|
</Feedback>
|
|
</TextInput>
|
|
</Field>
|
|
</Validation>
|
|
<Validation MessageLocalizer="@LH.Localize">
|
|
<Field>
|
|
<FieldLabel>@L["DisplayName:Name"]</FieldLabel>
|
|
<TextInput @bind-Value="EditingEntity.Name">
|
|
<Feedback>
|
|
<ValidationError />
|
|
</Feedback>
|
|
</TextInput>
|
|
</Field>
|
|
</Validation>
|
|
<Validation MessageLocalizer="@LH.Localize">
|
|
<Field>
|
|
<FieldLabel>@L["DisplayName:Surname"]</FieldLabel>
|
|
<TextInput @bind-Value="EditingEntity.Surname">
|
|
<Feedback>
|
|
<ValidationError />
|
|
</Feedback>
|
|
</TextInput>
|
|
</Field>
|
|
</Validation>
|
|
<Validation MessageLocalizer="@LH.Localize">
|
|
<Field>
|
|
<FieldLabel>@L["DisplayName:Password"]</FieldLabel>
|
|
<Addons>
|
|
<Addon AddonType="AddonType.Body">
|
|
<TextInput Role="@_passwordTextRole" @bind-Value="EditingEntity.Password">
|
|
</TextInput>
|
|
</Addon>
|
|
<Addon AddonType="AddonType.End">
|
|
<Button Color="Color.Secondary" Clicked="@(() => ChangePasswordTextRole(null))"
|
|
aria-label="@UiLocalizer["ShowPassword"]" aria-pressed="@(ShowPassword ? "true" : "false")">
|
|
<Icon Name="ShowPassword ? IconName.Eye : IconName.EyeSlash" aria-hidden="true" />
|
|
</Button>
|
|
</Addon>
|
|
</Addons>
|
|
<ValidationError Style="display: block" />
|
|
</Field>
|
|
</Validation>
|
|
<Validation MessageLocalizer="@LH.Localize">
|
|
<Field>
|
|
<FieldLabel>@L["DisplayName:Email"] *</FieldLabel>
|
|
<TextInput @bind-Value="EditingEntity.Email">
|
|
<Feedback>
|
|
<ValidationError />
|
|
</Feedback>
|
|
</TextInput>
|
|
</Field>
|
|
</Validation>
|
|
<Validation MessageLocalizer="@LH.Localize">
|
|
<Field>
|
|
<FieldLabel>@L["DisplayName:PhoneNumber"]</FieldLabel>
|
|
<TextInput @bind-Value="EditingEntity.PhoneNumber">
|
|
<Feedback>
|
|
<ValidationError />
|
|
</Feedback>
|
|
</TextInput>
|
|
</Field>
|
|
</Validation>
|
|
@if (!IsEditCurrentUser)
|
|
{
|
|
<Field>
|
|
<Check TValue="bool" @bind-Value="EditingEntity.IsActive">@L["DisplayName:IsActive"]</Check>
|
|
</Field>
|
|
}
|
|
<Field>
|
|
<Tooltip Text="@L["Description:LockoutEnabled"].Value" style="width: fit-content;" Placement="TooltipPlacement.Right" >
|
|
<Check TValue="bool" @bind-Value="EditingEntity.LockoutEnabled">@L["DisplayName:LockoutEnabled"] <Icon Name="IconName.InfoCircle"/> </Check>
|
|
</Tooltip>
|
|
</Field>
|
|
<ExtensionProperties TEntityType="IdentityUserUpdateDto" TResourceType="IdentityResource" Entity="@EditingEntity" LH="@LH" ModalType="ExtensionPropertyModalType.EditModal" />
|
|
</TabPanel>
|
|
@if (EditUserRoles != null && EditUserRoles.Any())
|
|
{
|
|
<TabPanel Name="Roles">
|
|
@if (EditUserRoles != null)
|
|
{
|
|
@foreach (var role in EditUserRoles)
|
|
{
|
|
<Field>
|
|
<input type="hidden" @bind-value="@role.Name" />
|
|
<Check TValue="bool" @bind-Value="@role.IsAssigned" Disabled="@(!role.IsAssignable)">@role.Name</Check>
|
|
</Field>
|
|
}
|
|
}
|
|
</TabPanel>
|
|
}
|
|
</Content>
|
|
</Tabs>
|
|
</Validations>
|
|
</ModalBody>
|
|
<ModalFooter>
|
|
<Button Color="Color.Primary" Outline Clicked="CloseEditModalAsync">@L["Cancel"]</Button>
|
|
<SubmitButton Form="EditUserForm" Clicked="@UpdateEntityAsync" />
|
|
</ModalFooter>
|
|
</Form>
|
|
</ModalContent>
|
|
</Modal>
|
|
}
|
|
|
|
@if (HasManagePermissionsPermission)
|
|
{
|
|
<PermissionManagementModal @ref="PermissionManagementModal" />
|
|
}
|
|
|