From 1656eeb8683fc5f20e919dad4fa0e31b5f94533c Mon Sep 17 00:00:00 2001 From: "HOME-LAPTOP\\kshkulev" Date: Fri, 17 Oct 2025 11:29:05 +0900 Subject: [PATCH] Add busy dialog --- Hcs.WebApp/Components/Layout/MainLayout.razor | 1 + .../Components/Pages/Account/Manage.razor | 8 ++++++ Hcs.WebApp/Components/Shared/BusyDialog.razor | 26 +++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 Hcs.WebApp/Components/Shared/BusyDialog.razor diff --git a/Hcs.WebApp/Components/Layout/MainLayout.razor b/Hcs.WebApp/Components/Layout/MainLayout.razor index 1823f3f..264fbdb 100644 --- a/Hcs.WebApp/Components/Layout/MainLayout.razor +++ b/Hcs.WebApp/Components/Layout/MainLayout.razor @@ -5,6 +5,7 @@ @inject NavigationManager NavigationManager @inject NotificationService NotificationService + diff --git a/Hcs.WebApp/Components/Pages/Account/Manage.razor b/Hcs.WebApp/Components/Pages/Account/Manage.razor index e83291f..93f9bb2 100644 --- a/Hcs.WebApp/Components/Pages/Account/Manage.razor +++ b/Hcs.WebApp/Components/Pages/Account/Manage.razor @@ -58,6 +58,7 @@ + @code { sealed class PasswordInputModel @@ -72,6 +73,7 @@ bool hasError; string? errorMessage; bool hasSuccess; + BusyDialog busyDialog; [SupplyParameterFromForm] PasswordInputModel PasswordInput { get; set; } = new(); @@ -83,6 +85,8 @@ try { + busyDialog.Show(); + await IdentityService.ChangePassword(PasswordInput.OldPassword, PasswordInput.NewPassword); hasSuccess = true; @@ -92,5 +96,9 @@ hasError = true; errorMessage = e.Message; } + finally + { + busyDialog.Hide(); + } } } diff --git a/Hcs.WebApp/Components/Shared/BusyDialog.razor b/Hcs.WebApp/Components/Shared/BusyDialog.razor new file mode 100644 index 0000000..fb7b524 --- /dev/null +++ b/Hcs.WebApp/Components/Shared/BusyDialog.razor @@ -0,0 +1,26 @@ +@inject DialogService DialogService + +@code { + public void Show() + { + DialogService.Open( + "", + x => + @ + + Пожалуйста, подождите... + , + new DialogOptions() + { + ShowTitle = false, + Style = "min-height:auto;min-width:auto;width:auto", + CloseDialogOnEsc = false, + CssClass = "" + }); + } + + public void Hide() + { + DialogService.Close(); + } +}