Add busy dialog
This commit is contained in:
@ -5,6 +5,7 @@
|
|||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
@inject NotificationService NotificationService
|
@inject NotificationService NotificationService
|
||||||
|
|
||||||
|
<RadzenDialog />
|
||||||
<RadzenLayout>
|
<RadzenLayout>
|
||||||
<RadzenHeader>
|
<RadzenHeader>
|
||||||
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" Gap="0">
|
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" Gap="0">
|
||||||
|
|||||||
@ -58,6 +58,7 @@
|
|||||||
</RadzenTabsItem>
|
</RadzenTabsItem>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</RadzenTabs>
|
</RadzenTabs>
|
||||||
|
<BusyDialog @ref=@busyDialog />
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
sealed class PasswordInputModel
|
sealed class PasswordInputModel
|
||||||
@ -72,6 +73,7 @@
|
|||||||
bool hasError;
|
bool hasError;
|
||||||
string? errorMessage;
|
string? errorMessage;
|
||||||
bool hasSuccess;
|
bool hasSuccess;
|
||||||
|
BusyDialog busyDialog;
|
||||||
|
|
||||||
[SupplyParameterFromForm]
|
[SupplyParameterFromForm]
|
||||||
PasswordInputModel PasswordInput { get; set; } = new();
|
PasswordInputModel PasswordInput { get; set; } = new();
|
||||||
@ -83,6 +85,8 @@
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
busyDialog.Show();
|
||||||
|
|
||||||
await IdentityService.ChangePassword(PasswordInput.OldPassword, PasswordInput.NewPassword);
|
await IdentityService.ChangePassword(PasswordInput.OldPassword, PasswordInput.NewPassword);
|
||||||
|
|
||||||
hasSuccess = true;
|
hasSuccess = true;
|
||||||
@ -92,5 +96,9 @@
|
|||||||
hasError = true;
|
hasError = true;
|
||||||
errorMessage = e.Message;
|
errorMessage = e.Message;
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
busyDialog.Hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
26
Hcs.WebApp/Components/Shared/BusyDialog.razor
Normal file
26
Hcs.WebApp/Components/Shared/BusyDialog.razor
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
@inject DialogService DialogService
|
||||||
|
|
||||||
|
@code {
|
||||||
|
public void Show()
|
||||||
|
{
|
||||||
|
DialogService.Open(
|
||||||
|
"",
|
||||||
|
x =>
|
||||||
|
@<RadzenStack AlignItems="AlignItems.Center" Gap="2rem" class="rz-p-6">
|
||||||
|
<RadzenProgressBarCircular Value="100" ShowValue="false" Mode="ProgressBarMode.Indeterminate" />
|
||||||
|
<RadzenText TextStyle="TextStyle.H5">Пожалуйста, подождите...</RadzenText>
|
||||||
|
</RadzenStack>,
|
||||||
|
new DialogOptions()
|
||||||
|
{
|
||||||
|
ShowTitle = false,
|
||||||
|
Style = "min-height:auto;min-width:auto;width:auto",
|
||||||
|
CloseDialogOnEsc = false,
|
||||||
|
CssClass = ""
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Hide()
|
||||||
|
{
|
||||||
|
DialogService.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user