From 658d616cfbf4da4dee345df783dd6b72db609d7c Mon Sep 17 00:00:00 2001 From: Argo-Tianyi Date: Thu, 20 Jan 2022 13:50:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=81=A5=E5=BA=B7=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A3=80=E6=9F=A5=E4=B8=AD=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BootstrapAdmin.Web/Pages/Admin/Healths.razor.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Healths.razor.cs b/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Healths.razor.cs index 5e1f4328..d518ae03 100644 --- a/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Healths.razor.cs +++ b/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Healths.razor.cs @@ -29,13 +29,11 @@ public partial class Healths [NotNull] private DialogService? DialogService { get; set; } - [Inject] - [NotNull] - private BootstrapAdmin.Caching.ICacheManager? CacheManager { get; set; } - [NotNull] private HttpClient? Client { get; set; } + private bool IsRunning { get; set; } + /// /// /// @@ -45,6 +43,8 @@ public partial class Healths Client = HttpClientFactory.CreateClient(); Client.BaseAddress = new Uri(NavigationManager.BaseUri); + + IsRunning = true; } private async Task> OnQueryAsync(QueryPageOptions options) @@ -63,12 +63,15 @@ public partial class Healths Duration = report.Duration; Status = report.Status; + IsRunning = false; StateHasChanged(); return ret; } private async Task OnCheck() { + IsRunning = true; + StateHasChanged(); await HealthTable.ToggleLoading(true); await HealthTable.QueryAsync(); await HealthTable.ToggleLoading(false); @@ -76,7 +79,7 @@ public partial class Healths private static List GetNameLookup() => LookupHelper.GetCheckItems(); - private string? GetTagText(HealthStatus? status = null) => (status ?? Status) switch + private string? GetTagText(HealthStatus? status = null) => IsRunning ? "检查中 ..." : (status ?? Status) switch { HealthStatus.Healthy => "健康", HealthStatus.Degraded => "亚健康",