Skip to content

Commit b6f47f0

Browse files
authored
doc(Exception): reduce exception records (#5235)
* refactor: 精简代码 * doc: 精简提示信息 * doc: 更新 GlobalException 描述信息 * doc: 增加缓存键值列样式 * refactor: 重构代码
1 parent cfcd597 commit b6f47f0

File tree

6 files changed

+14
-9
lines changed

6 files changed

+14
-9
lines changed

src/BootstrapBlazor.Server/Components/Layout/HomeLayout.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
</div>
6161
<div class="footer-info">
6262
<div class="d-flex">
63-
<div>Powered by .NET @Version on @OS</div>
63+
<div>SDK .NET @Version on @OS</div>
6464
<div class="ms-1">BB @VersionService.Version</div>
6565
<FooterCounter></FooterCounter>
6666
<CacheCounter></CacheCounter>

src/BootstrapBlazor.Server/Components/Pages/CacheList.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
@GetKey(v.Row)
1414
</Template>
1515
</TableTemplateColumn>
16-
<TableTemplateColumn Text="@Localizer["CacheListValue"]" TextWrap="true" Width="220">
16+
<TableTemplateColumn Text="@Localizer["CacheListValue"]" TextWrap="true" Width="220" CssClass="table-cache-value scroll">
1717
<Template Context="v">
1818
@GetValue(v.Row)
1919
</Template>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
.table-cache-list {
22
height: calc(100vh - 180px);
33
}
4+
5+
::deep .table-cache-value {
6+
max-height: 80px;
7+
overflow: auto;
8+
align-items: flex-start;
9+
}

src/BootstrapBlazor.Server/Components/Samples/Downloads.razor.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,9 @@ private async Task DownloadFolderAsync()
5050
{
5151
await DownloadService.DownloadFolderAsync("test.zip", WebsiteOption.CurrentValue.WebRootPath);
5252
}
53-
catch (FileNotFoundException msg)
53+
catch (Exception ex)
5454
{
55-
56-
await ToastService.Error("下载", msg.Message);
55+
await ToastService.Error("下载", ex.Message);
5756
}
5857
}
5958

src/BootstrapBlazor.Server/Components/Samples/GlobalException.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@
3939
OS: Microsoft Windows 10.0.17763
4040
OSArchitecture: X64
4141
ProcessArchitecture: X64
42-
Framework: .NET 5.0.9
42+
Framework: .NET 9.0.0
4343
UserName: Argo
4444
EnvironmentName: Development
4545
IISRootPath: D:\Argo\src\BB\BootstrapBlazor\src\BootstrapBlazor.Server\
4646
VSIDE: Microsoft Visual Studio Enterprise 2019 16.0
4747
Exception:: Attempted to divide by zero.
4848
*********************************************
4949
System.DivideByZeroException: Attempted to divide by zero.
50-
at BootstrapBlazor.Server.Components.Samples.GlobalException.OnClick() in D:\Argo\src\BB\BootstrapBlazor\src\BootstrapBlazor.Server\Components\Samples\GlobalException.razor.cs:line 30</Pre>
50+
at BootstrapBlazor.Server.Components.Samples.GlobalException.OnClick() in D:\Argo\src\BB\BootstrapBlazor\src\BootstrapBlazor.Server\Components\Samples\GlobalException.razor.cs:line 24</Pre>
5151

5252
<p>@((MarkupString)Localizer["Step5"].Value)</p>
5353

src/BootstrapBlazor/Utils/Utility.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ public static void CreateDisplayByFieldType(this RenderTreeBuilder builder, IEdi
398398
{
399399
var fieldType = item.PropertyType;
400400
var fieldName = item.GetFieldName();
401-
var displayName = item.GetDisplayName() ?? GetDisplayName(model, fieldName);
401+
var displayName = item.GetDisplayName();
402402
var fieldValue = GenerateValue(model, fieldName);
403403
var type = (Nullable.GetUnderlyingType(fieldType) ?? fieldType);
404404
if (type == typeof(bool) || fieldValue?.GetType() == typeof(bool))
@@ -474,7 +474,7 @@ public static void CreateComponentByFieldType(this RenderTreeBuilder builder, Co
474474
{
475475
var fieldType = item.PropertyType;
476476
var fieldName = item.GetFieldName();
477-
var displayName = item.GetDisplayName() ?? GetDisplayName(model, fieldName);
477+
var displayName = item.GetDisplayName();
478478

479479
var fieldValue = GenerateValue(model, fieldName);
480480
var fieldValueChanged = GenerateValueChanged(component, model, fieldName, fieldType);

0 commit comments

Comments
 (0)