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
21 changes: 11 additions & 10 deletions src/BootstrapBlazor.Server/Components/Pages/CacheList.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,24 @@ public partial class CacheList
[Inject, NotNull]
private IStringLocalizer<CacheList>? Localizer { get; set; }

private List<object> _cacheList = [];
private List<object?> _cacheList = [];

/// <summary>
/// <inheritdoc/>
/// </summary>
protected override async Task OnParametersSetAsync()
protected override void OnInitialized()
{
await base.OnParametersSetAsync();

await Task.Yield();
base.OnInitialized();
UpdateCacheList();
}

private void OnDelete(object key)
{
CacheManager.Clear(key);
UpdateCacheList();
if (key is ICacheEntry entry)
{
CacheManager.Clear(entry.Key);
UpdateCacheList();
}
}

private void OnDeleteAll()
Expand All @@ -51,15 +52,15 @@ private void OnRefresh()

private void UpdateCacheList()
{
_cacheList = CacheManager.Keys.OrderBy(i => i.ToString()).Select(key =>
_cacheList = [.. CacheManager.Keys.OrderBy(i => i.ToString()).Select(key =>
{
ICacheEntry? entry = null;
if (CacheManager.TryGetCacheEntry(key, out var val))
{
entry = val;
}
return (object)entry!;
}).ToList();
return entry;
}).Where(i => i != null)];
}

private static string GetKey(object data) => data is ICacheEntry entry ? entry.Key.ToString()! : "-";
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor.Server/Components/Samples/Stacks.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

<DemoBlock Title="@Localizer["BasicTitle"]" Introduction="@Localizer["BasicIntroe"]" Name="Normal">
<DemoBlock Title="@Localizer["BasicTitle"]" Introduction="@Localizer["BasicIntro"]" Name="Normal">
<section ignore class="row g-3">
<div class="col-12">
<BootstrapInputGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor.Server/Locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -6469,7 +6469,7 @@
"BootstrapBlazor.Server.Components.Samples.Stacks": {
"Title": "Stack Layout",
"BasicTitle": "Basic",
"BasicIntroe": "Lets you arrange its subcomponents in a horizontal or vertical stack",
"BasicIntro": "Lets you arrange its subcomponents in a horizontal or vertical stack",
"RowMode": "Row",
"ColumnMode": "Column",
"Mode": "mode",
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor.Server/Locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -6469,7 +6469,7 @@
"BootstrapBlazor.Server.Components.Samples.Stacks": {
"Title": "Stack 布局",
"BasicTitle": "普通用法",
"BasicIntroe": "可用于在水平或垂直堆栈中排列其子组件",
"BasicIntro": "可用于在水平或垂直堆栈中排列其子组件",
"RowMode": "行布局",
"ColumnMode": "列布局",
"Mode": "布局类型",
Expand Down