File tree Expand file tree Collapse file tree
src/components/BootstrapBlazor.Tasks.Dashboard Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 "ButtonRun" : " Run" ,
2020 "ButtonLog" : " Log" ,
2121 "LogDilaogTitle" : " {0} - Log(Latest 20 Items)" ,
22- "LogDilaogConsoleHeaderText" : " Action Log"
22+ "LogDilaogConsoleHeaderText" : " Action Log" ,
23+ "ExceptionDilaogTitle" : " {0} - Exception Detail"
2324 }
2425}
Original file line number Diff line number Diff line change 1919 "ButtonRun" : " 运行" ,
2020 "ButtonLog" : " 日志" ,
2121 "LogDilaogTitle" : " {0} - 日志窗口(最新 20 条)" ,
22- "LogDilaogConsoleHeaderText" : " 执行日志"
22+ "LogDilaogConsoleHeaderText" : " 执行日志" ,
23+ "ExceptionDilaogTitle" : " {0} - 异常明细"
2324 }
2425}
Original file line number Diff line number Diff line change 3131 </TableTemplateColumn >
3232 <TableTemplateColumn Text =" @Localizer[" Exception " ]" >
3333 <Template Context =" v" >
34- @if (v .Row .Exception ! = null )
34+ @if (v .Row .Exception = = null )
3535 {
3636 <Button Color =" Color.Danger" Size =" Size.ExtraSmall" Icon =" fa-solid fa-exclamation-circle"
37- OnClickWithoutRender =" () => OnShowException(v.Row.Exception)" ></Button >
37+ OnClickWithoutRender =" () => OnShowException(v.Row, v.Row .Exception)" ></Button >
3838 }
3939 </Template >
4040 </TableTemplateColumn >
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ private async Task OnLog(IScheduler scheduler)
8989 {
9090 var option = new DialogOption ( )
9191 {
92- Class = "modal-dialog-task" ,
92+ Class = "modal-dialog-task-log " ,
9393 Title = Localizer [ "LogDilaogTitle" , scheduler . Name ] ,
9494 Component = BootstrapDynamicComponent . CreateComponent < TaskInfo > ( new Dictionary < string , object ? >
9595 {
@@ -106,8 +106,18 @@ private async Task OnLog(IScheduler scheduler)
106106
107107 private static string ? FormatDateTime ( DateTimeOffset ? dateTime ) => dateTime ? . ToString ( "yyyy-MM-dd HH:mm:ss" ) ;
108108
109- private Task OnShowException ( Exception ex )
109+ private async Task OnShowException ( IScheduler scheduler , Exception ex )
110110 {
111- return Task . CompletedTask ;
111+ ex = new Exception ( "test" ) ;
112+ var option = new DialogOption ( )
113+ {
114+ Class = "modal-dialog-task-ex" ,
115+ IsScrolling = true ,
116+ Title = Localizer [ "ExceptionDilaogTitle" , scheduler . Name ] ,
117+ BodyTemplate = RenderException ( ex )
118+ } ;
119+ await DialogService . Show ( option ) ;
112120 }
121+
122+ private static RenderFragment RenderException ( Exception ex ) => builder => builder . AddContent ( 0 , ex . FormatMarkupString ( ) ) ;
113123}
You can’t perform that action at this time.
0 commit comments