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 => "亚健康",