Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/BootstrapBlazor.Server/Components/Pages/CacheList.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@page "/cache-list"
@page "/cache-list"

<h3>@Localizer["CacheListTitle"]</h3>

Expand Down Expand Up @@ -31,6 +31,10 @@
</TableColumns>
<TableToolbarBeforeTemplate>
<Button Text="@Localizer["CacheListDeleteAll"]" Icon="fa-solid fa-xmark" OnClick="OnDeleteAll"></Button>
@if (WebHost.IsDevelopment())
{
<Button Text="GC" Color="Color.Danger" OnClick="OnClickGC" class="ms-1"></Button>
Comment thread
ArgoZhang marked this conversation as resolved.
}
</TableToolbarBeforeTemplate>
<TableExtensionToolbarTemplate>
<Button Text="@Localizer["CacheListRefresh"]" Icon="fa-solid fa-refresh" OnClick="OnRefresh"></Button>
Expand Down
10 changes: 9 additions & 1 deletion src/BootstrapBlazor.Server/Components/Pages/CacheList.razor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License
// See the LICENSE file in the project root for more information.
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
Expand All @@ -19,6 +19,9 @@ public partial class CacheList
[Inject, NotNull]
private IStringLocalizer<CacheList>? Localizer { get; set; }

[Inject, NotNull]
private IWebHostEnvironment? WebHost { get; set; }

private List<object?> _cacheList = [];

/// <summary>
Expand All @@ -45,6 +48,11 @@ private void OnDeleteAll()
UpdateCacheList();
}

private static void OnClickGC()
{
GC.Collect();
}
Comment thread
ArgoZhang marked this conversation as resolved.

private void OnRefresh()
{
UpdateCacheList();
Expand Down
Loading