Skip to content

Commit d5bc683

Browse files
committed
doc: 增加异常 UI 格式化逻辑
1 parent 9a3f70e commit d5bc683

4 files changed

Lines changed: 19 additions & 13 deletions

File tree

src/components/BootstrapBlazor.Tasks.Dashboard/Locales/en-US.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
"ButtonPause": "Pause",
1919
"ButtonRun": "Run",
2020
"ButtonLog": "Log",
21-
"LogDilaogTitle": "{0} - Log(Latest 20 Items)",
22-
"LogDilaogConsoleHeaderText": "Action Log",
23-
"ExceptionDilaogTitle": "{0} - Exception Detail"
21+
"LogDialogTitle": "{0} - Log(Latest 20 Items)",
22+
"LogDialogConsoleHeaderText": "Action Log",
23+
"ExceptionDialogTitle": "{0} - Exception Detail",
24+
"None": "None"
2425
}
2526
}

src/components/BootstrapBlazor.Tasks.Dashboard/Locales/zh-CN.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
"ButtonPause": "暂停",
1919
"ButtonRun": "运行",
2020
"ButtonLog": "日志",
21-
"LogDilaogTitle": "{0} - 日志窗口(最新 20 条)",
22-
"LogDilaogConsoleHeaderText": "执行日志",
23-
"ExceptionDilaogTitle": "{0} - 异常明细"
21+
"LogDialogTitle": "{0} - 日志窗口(最新 20 条)",
22+
"LogDialogConsoleHeaderText": "执行日志",
23+
"ExceptionDialogTitle": "{0} - 异常明细",
24+
"None": ""
2425
}
2526
}

src/components/BootstrapBlazor.Tasks.Dashboard/TaskDashboard.razor

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,21 @@
3636
<Button Color="Color.Danger" Size="Size.ExtraSmall" Icon="fa-solid fa-exclamation-circle"
3737
OnClickWithoutRender="() => OnShowException(v.Row, v.Row.Exception)"></Button>
3838
}
39+
else
40+
{
41+
<Tag Color="Color.Success">@Localizer["None"]</Tag>
42+
}
3943
</Template>
4044
</TableTemplateColumn>
41-
<TableTemplateColumn Text="@Localizer["Operation"]">
45+
<TableTemplateColumn Text="@Localizer["Operation"]" Width="170">
4246
<Template Context="v">
4347
<div class="btn-group">
4448
<Button Size="Size.ExtraSmall" Color="Color.Warning" Icon="fa-solid fa-pause-circle"
45-
Text="@Localizer["ButtonPause"]" OnClick="() => OnPause(v.Row)" IsDisabled="OnCheckPauseTaskStatus(v.Row)" />
49+
Text="@Localizer["ButtonPause"]" OnClick="() => OnPause(v.Row)" IsDisabled="OnCheckPauseTaskStatus(v.Row)"></Button>
4650
<Button Size="Size.ExtraSmall" Color="Color.Success" Icon="fa-solid fa-play-circle"
47-
Text="@Localizer["ButtonRun"]" OnClick="() => OnRun(v.Row)" IsDisabled="OnCheckRunTaskStatus(v.Row)" />
51+
Text="@Localizer["ButtonRun"]" OnClick="() => OnRun(v.Row)" IsDisabled="OnCheckRunTaskStatus(v.Row)"></Button>
4852
<Button Size="Size.ExtraSmall" Color="Color.Info" Icon="fa-solid fa-info-circle"
49-
Text="@Localizer["ButtonLog"]" OnClick="() => OnLog(v.Row)" />
53+
Text="@Localizer["ButtonLog"]" OnClick="() => OnLog(v.Row)"></Button>
5054
</div>
5155
</Template>
5256
</TableTemplateColumn>

src/components/BootstrapBlazor.Tasks.Dashboard/TaskDashboard.razor.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ private async Task OnLog(IScheduler scheduler)
9090
var option = new DialogOption()
9191
{
9292
Class = "modal-dialog-task-log",
93-
Title = Localizer["LogDilaogTitle", scheduler.Name],
93+
Title = Localizer["LogDialogTitle", scheduler.Name],
9494
Component = BootstrapDynamicComponent.CreateComponent<TaskInfo>(new Dictionary<string, object?>
9595
{
9696
[nameof(TaskInfo.Scheduler)] = scheduler,
97-
[nameof(TaskInfo.HeaderText)] = Localizer["LogDilaogConsoleHeaderText"].Value
97+
[nameof(TaskInfo.HeaderText)] = Localizer["LogDialogConsoleHeaderText"].Value
9898
})
9999
};
100100
await DialogService.Show(option);
@@ -112,7 +112,7 @@ private async Task OnShowException(IScheduler scheduler, Exception ex)
112112
{
113113
Class = "modal-dialog-task-ex",
114114
IsScrolling = true,
115-
Title = Localizer["ExceptionDilaogTitle", scheduler.Name],
115+
Title = Localizer["ExceptionDialogTitle", scheduler.Name],
116116
BodyTemplate = RenderException(ex)
117117
};
118118
await DialogService.Show(option);

0 commit comments

Comments
 (0)