198 lines
9.4 KiB
Plaintext
198 lines
9.4 KiB
Plaintext
@if (ShowPopup)
|
|
{
|
|
<div class="modal" tabindex="-1" style="display:block" role="dialog">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h3 class="modal-title">Edit User</h3>
|
|
<!-- Button to close the popup -->
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" @onclick="ClosePopup">
|
|
</button>
|
|
</div>
|
|
<!-- Edit form for the current user -->
|
|
<div class="modal-body">
|
|
@* <div class="row">
|
|
<div class="col-6">
|
|
<div class="input-group mb-2">
|
|
<span class="input-group-text"><i class="far fa-envelope"></i></span>
|
|
<input class="form-control" type="text" placeholder="Email" @bind="objUser.Email" />
|
|
<div class="input-group-text">
|
|
<input class="form-control2" type="checkbox" title="Email Confirmed" @bind="objUser.EmailConfirmed" />
|
|
</div>
|
|
</div>
|
|
<div class="input-group mb-2">
|
|
<span class="input-group-text"><i class="fas fa-key"></i></span>
|
|
<input class="form-control" type="password" placeholder="Password" @bind="objUser.PasswordHash" />
|
|
</div>
|
|
<div class="input-group mb-2">
|
|
<span class="input-group-text"><i class="fas fa-user-tag"></i></span>
|
|
@if (MultiRoleEnab)
|
|
{
|
|
<select @bind="CurrUserRoles" multiple class="form-control">
|
|
@foreach (var option in RolesList)
|
|
{
|
|
<option value="@option">
|
|
@option
|
|
</option>
|
|
}
|
|
</select>
|
|
}
|
|
else
|
|
{
|
|
<select class="form-select" @bind="@CurrentUserRole">
|
|
@foreach (var option in RolesList)
|
|
{
|
|
<option value="@option">
|
|
@option
|
|
</option>
|
|
}
|
|
</select>
|
|
}
|
|
</div>
|
|
|
|
<div class="input-group mb-2">
|
|
@if (MultiClaimEnab)
|
|
{
|
|
<CmpClaimEdit Value="CurrentUserClaims"></CmpClaimEdit>
|
|
}
|
|
else
|
|
{
|
|
<span class="input-group-text"><i class="fas fa-tag"></i></span>
|
|
<select class="form-select" @bind="@CurrentUserClaimType">
|
|
@foreach (var option in ClaimsList)
|
|
{
|
|
<option value="@option">
|
|
@option
|
|
</option>
|
|
}
|
|
</select>
|
|
<select class="form-select" @bind="@CurrentUserClaimVal">
|
|
<option value="0">--- Selezionare ---</option>
|
|
@foreach (var option in ClaimValList)
|
|
{
|
|
<option value="@option.Key">
|
|
@option.Value
|
|
</option>
|
|
}
|
|
</select>
|
|
}
|
|
</div>
|
|
<span style="color:red">@strError</span>
|
|
<hr />
|
|
<div class="row">
|
|
<div class="col-6">
|
|
<button class="btn w-100 btn-success" @onclick="SaveUser" title="Save"><i class="fas fa-check"></i> Save</button>
|
|
</div>
|
|
<div class="col-6">
|
|
<button class="btn w-100 btn-primary" @onclick="ClosePopup"><i class="far fa-window-close"></i> Close</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-6">
|
|
<!-- Only show Id if not a new user -->
|
|
@if (objUser.Id != "")
|
|
{
|
|
<QrCodeDisplayJS rawCode="@qrCodeVal" Height="450" Width="450"></QrCodeDisplayJS>
|
|
}
|
|
<CopyToClipboard Text="@qrCodeVal"></CopyToClipboard>
|
|
</div>
|
|
</div> *@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<div class="d-flex justify-content-between">
|
|
<div class="px-1 text-truncate">
|
|
<h3>User Administration</h3>
|
|
</div>
|
|
<div class="px-1">
|
|
<div class="input-group">
|
|
<span class="input-group-text"><i class="fas fa-user-tag"></i></span>
|
|
<select class="form-select" @bind="@FiltUserRole">
|
|
<option value="0">--- Tutti ---</option>
|
|
@foreach (var item in RolesList)
|
|
{
|
|
<option value="@item.RoleID">
|
|
@item.Ruolo
|
|
</option>
|
|
}
|
|
</select>
|
|
@* <AuthorizeView>
|
|
<Authorized>
|
|
@if (@context.User.IsInRole("SuperAdmin"))
|
|
{
|
|
<button class="btn btn-success btn-block" @onclick="AddNewUser"><i class="fa-solid fa-user-plus"></i> Add User</button>
|
|
}
|
|
</Authorized>
|
|
</AuthorizeView> *@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card-body">
|
|
|
|
<table class="table table-sm table-striped table-responsive-md">
|
|
<thead>
|
|
<tr>
|
|
<th></th>
|
|
<th>AD User</th>
|
|
<th>Cognome</th>
|
|
<th>Nome</th>
|
|
<th>Ruolo</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var user in UsersList)
|
|
{
|
|
<tr>
|
|
<td>
|
|
@if (!ShowPopup)
|
|
{
|
|
<button class="btn btn-sm btn-primary" @onclick="(() => EditUser(user))" title="Edit">
|
|
<i class="fas fa-pen"></i>
|
|
</button>
|
|
}
|
|
else
|
|
{
|
|
<button class="btn btn-sm btn-secondary disabled" title="Edit">
|
|
<i class="fas fa-pen"></i>
|
|
</button>
|
|
}
|
|
</td>
|
|
<td>@user.Username</td>
|
|
<td>
|
|
@user.Cognome
|
|
</td>
|
|
<td>
|
|
@user.Nome
|
|
</td>
|
|
<td>
|
|
@ShowRoles(user.Claims.ToList())
|
|
</td>
|
|
<td>
|
|
@if (!ShowPopup)
|
|
{
|
|
<button class="btn btn-sm btn-danger" @onclick="(() => DeleteUser(user))" title="Delete">
|
|
<i class="fas fa-trash"></i>
|
|
</button>
|
|
}
|
|
else
|
|
{
|
|
<button class="btn btn-sm btn-secondary disabled" title="Delete">
|
|
<i class="fas fa-trash"></i>
|
|
</button>
|
|
}
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="card-footer">
|
|
<DataPager PageSize="@numRecord" currPage="@currPage" numRecordChanged="SetNumRec" numPageChanged="SetPage" totalCount="@totalCount" showLoading="@isLoading"></DataPager>
|
|
</div>
|
|
</div> |