Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ab9adbd
refactor: 更新日志逻辑
ArgoZhang Jan 21, 2026
b2a017a
test: 更新单元测试
ArgoZhang Jan 21, 2026
5a3cd88
doc: 更新示例
ArgoZhang Jan 21, 2026
5a70964
test: 更新单元测试
ArgoZhang Jan 21, 2026
0a3a5a2
feat: 增加 ErrorRender 组件
ArgoZhang Jan 21, 2026
200965b
doc: 文档格式化
ArgoZhang Jan 21, 2026
e9285f3
doc: 文档格式化
ArgoZhang Jan 21, 2026
31179f3
Merge branch 'main' into fix-error
ArgoZhang Jan 21, 2026
6eed865
refactor: 增加异常日志等逻辑
ArgoZhang Jan 21, 2026
8086de2
test: 更新单元测试
ArgoZhang Jan 21, 2026
292810a
Merge branch 'main' into fix-error
ArgoZhang Jan 22, 2026
6aa5263
refactor: 增加 ToastTitle 本地化位置
ArgoZhang Jan 22, 2026
a9b66c4
doc: 更新注释
ArgoZhang Jan 22, 2026
4edac12
feat: 增加日志开关逻辑
ArgoZhang Jan 22, 2026
6d9319a
refactor: 重构异常处理机制
ArgoZhang Jan 22, 2026
2939a4c
test: 更新单元测试
ArgoZhang Jan 22, 2026
00c877a
refactor: 重构代码
ArgoZhang Jan 22, 2026
cdda94d
test: 排除单元测试
ArgoZhang Jan 22, 2026
5a14521
doc: 更新示例
ArgoZhang Jan 22, 2026
aadd3ce
refactor: 重构代码
ArgoZhang Jan 22, 2026
2669c1b
test: 更新单元测试
ArgoZhang Jan 22, 2026
8ae2cc4
test: 支持弹窗显示错误信息
ArgoZhang Jan 22, 2026
cf01d37
test: 增加单元测试
ArgoZhang Jan 22, 2026
4a45288
doc: 更新示例
ArgoZhang Jan 22, 2026
a74fc6d
doc: 增加排序
ArgoZhang Jan 22, 2026
de38fcd
chore: 重构代码
ArgoZhang Jan 22, 2026
9ffadb5
doc: 更新注释
ArgoZhang Jan 22, 2026
d43af10
chore: bump version 10.2.2
ArgoZhang Jan 22, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,16 @@
"DetailedErrors": true
}</Pre>

<DemoBlock Title="@Localizer["Block1Title"]" Introduction="@Localizer["Block1Intro"]" Name="Normal">
<DemoBlock Title="@Localizer["NormalTitle"]" Introduction="@Localizer["NormalIntro"]" Name="Normal">
<section ignore>@((MarkupString)Localizer["ExceptionTestIntroduce"].Value)</section>
<Button Icon="fa-solid fa-font-awesome" Text="@Localizer["ButtonText"]" OnClick="OnClick" />
<Button Icon="fa-solid fa-font-awesome" Text="@Localizer["Button1Text"]" OnClick="OnClick" />
<button class="btn btn-primary" @onclick="OnClick">
<i class="fa-solid fa-font-awesome"></i>
<span>@Localizer["Button2Text"]</span>
</button>
</DemoBlock>

<DemoBlock Title="@Localizer["Block2Title"]" Introduction="@Localizer["Block2Intro"]" Name="Swal">
<DemoBlock Title="@Localizer["OnErrorHandleTitle"]" Introduction="@Localizer["OnErrorHandleIntro"]" Name="Swal">
<ErrorLogger OnErrorHandleAsync="OnErrorHandleAsync">
<Button Icon="fa-solid fa-font-awesome" Text="@Localizer["ButtonText"]" OnClick="OnClick" />
</ErrorLogger>
Expand Down
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 Down
14 changes: 8 additions & 6 deletions src/BootstrapBlazor.Server/Locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"Type": "Type"
},
"BootstrapBlazor.Server.Components.Components.AttributeTable": {
"Obsolete": "Obsolete",
"AutoGenerateColumns": "Automatically generated",
"Obsolete": "Obsolete",
"Total": "Total"
},
"BootstrapBlazor.Server.Components.Components.CultureChooser": {
Expand Down Expand Up @@ -2407,17 +2407,19 @@
"WatchPositionResultSuccess": "Call WatchPosition success"
},
"BootstrapBlazor.Server.Components.Samples.GlobalException": {
"Block1Intro": "This function is to obtain the component instance through the cascade parameter and use its function",
"Block1Title": "Test",
"Block2Intro": "Set custom exception handling logic by setting <code>OnErrorHandleAsync</code> callback method",
"Block2Title": "OnErrorHandleAsync",
"ButtonText": "test",
"Button1Text": "Test(Component)",
"Button2Text": "Test(HtmlElement)",
"ButtonText": "Test",
"DialogIntro": "Click the button to pop up a pop-up window. The button in the pop-up window triggers an exception and the error is displayed in the pop-up window",
"DialogText": "Popup",
"DialogTitle": "In Dialog",
"ExceptionTestIntroduce": "In this example code, an error code that divides by zero is written. Because <code>try/catch</code> is used to capture the exception, the error message is displayed in the console below",
"H1": "Instructions",
"Introduce": "Added component <code>ErrorLogger</code> Through this component, global logs and exceptions can be output uniformly; currently, the <code>Blazor</code> framework does not provide a <code>MVC</code> like <b>Global exception</b> The overall solution",
"NormalIntro": "This function is to obtain the component instance through the cascade parameter and use its function",
"NormalTitle": "Test",
"OnErrorHandleIntro": "By setting the <code>OnErrorHandleAsync</code> parameter of <code>ErrorLogger</code>, you can customize the use of the <code>Swal</code> pop-up to display exception information.",
"OnErrorHandleTitle": "OnErrorHandleAsync",
"PageErrorIntro": "Click the button to navigate to the page where the error occurred during the page life cycle. The error is displayed on the current page and does not affect the menu and the overall page layout.",
"PageErrorTitle": "Page",
"Step1": "1. Add <code>AddLogging</code> to the <code>Startup</code> file to enable the <code>net core</code> system log function",
Expand Down
12 changes: 7 additions & 5 deletions src/BootstrapBlazor.Server/Locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"Type": "类型"
},
"BootstrapBlazor.Server.Components.Components.AttributeTable": {
"Obsolete": "已弃用",
"AutoGenerateColumns": "自动生成",
"Obsolete": "已弃用",
"Total": "合计"
},
"BootstrapBlazor.Server.Components.Components.CultureChooser": {
Expand Down Expand Up @@ -2407,17 +2407,19 @@
"WatchPositionResultSuccess": "调用 WatchPosition 成功"
},
"BootstrapBlazor.Server.Components.Samples.GlobalException": {
"Block1Intro": "本功能是通过代码产生异常信息,由全局捕获组件统一处理",
"Block1Title": "测试",
"Block2Intro": "通过设置 <code>OnErrorHandleAsync</code> 回调方法,设置自定义异常处理逻辑",
"Block2Title": "自定义错误处理",
"Button1Text": "测试(组件)",
"Button2Text": "测试(原生)",
"ButtonText": "测试",
"DialogIntro": "点击按钮弹出弹窗,弹窗内按钮触发异常,错误显示在弹窗内",
"DialogText": "弹窗",
"DialogTitle": "弹窗中异常捕获",
"ExceptionTestIntroduce": "本例代码中写了一个除以零的错误代码,并且未使用 <code>try/catch</code> 对异常进行捕获,系统并不会崩溃导致不可用,<ul class='ul-demo'><li><code>Debug</code> 模式下会显示错误的 <b>描述信息</b> 与 <b>堆栈信息</b></li><li><code>Release</code> 模式下默认使用 <code>Toast</code> 进行弹窗提示</li></ul>",
"H1": "使用方法",
"Introduce": "<p>增加组件 <code>ErrorLogger</code> 通过本组件可以对全局的日志、异常进行统一输出;目前由于 <code>Blazor</code> 框架并未提供一个类似 <code>MVC</code> 的 <b>全局异常</b> 整体解决方案;通过使用 <code>ErrorLogger</code> 组件 <b>无需任何额外代码</b> 即可进行全局异常捕获与处理</p>",
"NormalIntro": "本功能是通过代码产生异常信息,由全局捕获组件统一处理",
"NormalTitle": "测试",
"OnErrorHandleIntro": "通过设置 <code>ErrorLogger</code> 参数 <code>OnErrorHandleAsync</code> 自定义使用 <code>Swal</code> 弹窗显示异常信息",
"OnErrorHandleTitle": "自定义错误处理",
"PageErrorIntro": "点击按钮导航到页面生命周期内出错的页面,错误显示在当前页面,不影响菜单以及整体页面布局",
"PageErrorTitle": "页面异常捕获",
"Step1": "1. <code>Startup</code> 文件中增加 <code>AddLogging</code> 开启 <code>net core</code> 系统日志功能,支持其他第三方 <code>Logger</code> 组件",
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/BootstrapBlazor.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>10.2.2-beta02</Version>
<Version>10.2.2</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading