From 5194f70fc4cdda34760d451f485d42fa3eae29f1 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 23 Feb 2025 00:05:27 +0800 Subject: [PATCH 1/4] =?UTF-8?q?doc:=20=E6=9B=B4=E6=AD=A3=E5=8D=95=E8=AF=8D?= =?UTF-8?q?=E6=8B=BC=E5=86=99=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor.Server/Components/Samples/Stacks.razor | 2 +- src/BootstrapBlazor.Server/Locales/en-US.json | 2 +- src/BootstrapBlazor.Server/Locales/zh-CN.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BootstrapBlazor.Server/Components/Samples/Stacks.razor b/src/BootstrapBlazor.Server/Components/Samples/Stacks.razor index a769e41561f..2c343e826b7 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Stacks.razor +++ b/src/BootstrapBlazor.Server/Components/Samples/Stacks.razor @@ -3,7 +3,7 @@

@Localizer["Title"]

- +
diff --git a/src/BootstrapBlazor.Server/Locales/en-US.json b/src/BootstrapBlazor.Server/Locales/en-US.json index 293011dbea2..da989fc7f7a 100644 --- a/src/BootstrapBlazor.Server/Locales/en-US.json +++ b/src/BootstrapBlazor.Server/Locales/en-US.json @@ -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", diff --git a/src/BootstrapBlazor.Server/Locales/zh-CN.json b/src/BootstrapBlazor.Server/Locales/zh-CN.json index 9b622cd44c6..073ccc0977a 100644 --- a/src/BootstrapBlazor.Server/Locales/zh-CN.json +++ b/src/BootstrapBlazor.Server/Locales/zh-CN.json @@ -6469,7 +6469,7 @@ "BootstrapBlazor.Server.Components.Samples.Stacks": { "Title": "Stack 布局", "BasicTitle": "普通用法", - "BasicIntroe": "可用于在水平或垂直堆栈中排列其子组件", + "BasicIntro": "可用于在水平或垂直堆栈中排列其子组件", "RowMode": "行布局", "ColumnMode": "列布局", "Mode": "布局类型", From eae05b30fd4be454a45fc3a64b7e0c0f1d96f032 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 23 Feb 2025 00:17:45 +0800 Subject: [PATCH 2/4] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=20cache-list?= =?UTF-8?q?=20=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Pages/CacheList.razor.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/BootstrapBlazor.Server/Components/Pages/CacheList.razor.cs b/src/BootstrapBlazor.Server/Components/Pages/CacheList.razor.cs index 689112eb9dc..2d0f7c3482b 100644 --- a/src/BootstrapBlazor.Server/Components/Pages/CacheList.razor.cs +++ b/src/BootstrapBlazor.Server/Components/Pages/CacheList.razor.cs @@ -19,16 +19,14 @@ public partial class CacheList [Inject, NotNull] private IStringLocalizer? Localizer { get; set; } - private List _cacheList = []; + private List _cacheList = []; /// /// /// - protected override async Task OnParametersSetAsync() + protected override void OnInitialized() { - await base.OnParametersSetAsync(); - - await Task.Yield(); + base.OnInitialized(); UpdateCacheList(); } @@ -51,15 +49,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; + })]; } private static string GetKey(object data) => data is ICacheEntry entry ? entry.Key.ToString()! : "-"; From 948a3f5e79d9dadeaef18bffbd12734e4b995516 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 23 Feb 2025 00:31:55 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Pages/CacheList.razor.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/BootstrapBlazor.Server/Components/Pages/CacheList.razor.cs b/src/BootstrapBlazor.Server/Components/Pages/CacheList.razor.cs index 2d0f7c3482b..0e91afac264 100644 --- a/src/BootstrapBlazor.Server/Components/Pages/CacheList.razor.cs +++ b/src/BootstrapBlazor.Server/Components/Pages/CacheList.razor.cs @@ -32,8 +32,11 @@ protected override void OnInitialized() private void OnDelete(object key) { - CacheManager.Clear(key); - UpdateCacheList(); + if (key is ICacheEntry entry) + { + CacheManager.Clear(entry.Key); + UpdateCacheList(); + } } private void OnDeleteAll() From bd9051f11235f3afe82d79e3a6b99a6cc6d270c5 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 23 Feb 2025 00:32:08 +0800 Subject: [PATCH 4/4] =?UTF-8?q?refactor:=20=E5=A2=9E=E5=8A=A0=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E6=9D=A1=E4=BB=B6=E9=98=B2=E6=AD=A2=E7=A9=BA=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor.Server/Components/Pages/CacheList.razor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BootstrapBlazor.Server/Components/Pages/CacheList.razor.cs b/src/BootstrapBlazor.Server/Components/Pages/CacheList.razor.cs index 0e91afac264..0f782f621dc 100644 --- a/src/BootstrapBlazor.Server/Components/Pages/CacheList.razor.cs +++ b/src/BootstrapBlazor.Server/Components/Pages/CacheList.razor.cs @@ -60,7 +60,7 @@ private void UpdateCacheList() entry = val; } return entry; - })]; + }).Where(i => i != null)]; } private static string GetKey(object data) => data is ICacheEntry entry ? entry.Key.ToString()! : "-";