diff --git a/src/admin/Bootstrap.Admin/Pages/Views/Admin/Exceptions.razor b/src/admin/Bootstrap.Admin/Pages/Views/Admin/Exceptions.razor new file mode 100644 index 00000000..8d434bcb --- /dev/null +++ b/src/admin/Bootstrap.Admin/Pages/Views/Admin/Exceptions.razor @@ -0,0 +1,32 @@ +@inherits ExceptionsBase + +
+
+ 查询结果 +
+
+ + + + + + + + + + + + + + + + + + + + + + +
@context.LogTime@context.ErrorPage@context.UserId@context.UserIp@context.ExceptionType@context.Message
+
+
diff --git a/src/admin/Bootstrap.Admin/Pages/Views/Components/ExceptionsBase.cs b/src/admin/Bootstrap.Admin/Pages/Views/Components/ExceptionsBase.cs new file mode 100644 index 00000000..a9d71824 --- /dev/null +++ b/src/admin/Bootstrap.Admin/Pages/Views/Components/ExceptionsBase.cs @@ -0,0 +1,61 @@ +using Bootstrap.Admin.Pages.Components; +using Bootstrap.Admin.Pages.Extensions; +using Bootstrap.DataAccess; +using Microsoft.AspNetCore.Components; +using System; + +namespace Bootstrap.Admin.Pages.Views.Admin.Components +{ + /// + /// 部门维护组件 + /// + public class ExceptionsBase : ComponentBase + { + /// + /// 获得/设置 编辑类型实例 + /// + protected Bootstrap.DataAccess.Exceptions DataContext { get; set; } = new Bootstrap.DataAccess.Exceptions(); + + /// + /// 获得/设置 查询绑定类型实例 + /// + protected Bootstrap.DataAccess.Exceptions QueryModel { get; set; } = new Bootstrap.DataAccess.Exceptions(); + + /// + /// 获得/设置 开始时间 + /// + protected DateTime? StartTime { get; set; } + + /// + /// 获得/设置 开始时间 + /// + protected DateTime? EndTime { get; set; } + + /// + /// 数据查询方法 + /// + /// + /// + protected QueryData Query(QueryPageOptions options) + { + var data = ExceptionsHelper.RetrievePages(options.ToPaginationOption(), StartTime, EndTime); + return data.ToQueryData(); + } + + /// + /// 重置搜索方法 + /// + protected void ResetSearch() + { + + } + + /// + /// 显示异常明细方法 + /// + protected void ShowDetail() + { + + } + } +} diff --git a/src/admin/Bootstrap.Admin/wwwroot/js/exceptions.js b/src/admin/Bootstrap.Admin/wwwroot/js/exceptions.js index 22c934dc..71cc1517 100644 --- a/src/admin/Bootstrap.Admin/wwwroot/js/exceptions.js +++ b/src/admin/Bootstrap.Admin/wwwroot/js/exceptions.js @@ -16,7 +16,7 @@ { title: "记录时间", field: "LogTime", sortable: true }, { title: "请求网址", field: "ErrorPage", sortable: true }, { title: "用户名", field: "UserId", sortable: true }, - { title: "IP", field: "UserIp", sortable: true }, + { title: "登录主机", field: "UserIp", sortable: true }, { title: "异常类型", field: "ExceptionType", sortable: false }, { title: "异常描述", field: "Message", sortable: false } ], diff --git a/src/admin/Bootstrap.DataAccess/Exceptions.cs b/src/admin/Bootstrap.DataAccess/Exceptions.cs index dfdfe476..da781dee 100644 --- a/src/admin/Bootstrap.DataAccess/Exceptions.cs +++ b/src/admin/Bootstrap.DataAccess/Exceptions.cs @@ -1,6 +1,7 @@ using Longbow.Web.Mvc; using PetaPoco; using System; +using System.ComponentModel; using System.Collections.Generic; using System.Collections.Specialized; using System.Data.Common; @@ -26,26 +27,31 @@ namespace Bootstrap.DataAccess /// /// 获得/设置 用户请求页面地址 /// + [DisplayName("请求网址")] public string ErrorPage { get; set; } = ""; /// /// 获得/设置 用户 ID /// + [DisplayName("用户名")] public string? UserId { get; set; } /// /// 获得/设置 用户 IP /// + [DisplayName("登录主机")] public string? UserIp { get; set; } /// /// 获得/设置 异常类型 /// + [DisplayName("异常类型")] public string? ExceptionType { get; set; } /// /// 获得/设置 异常错误描述信息 /// + [DisplayName("异常描述")] public string Message { get; set; } = ""; /// @@ -56,6 +62,7 @@ namespace Bootstrap.DataAccess /// /// 获得/设置 日志时间戳 /// + [DisplayName("记录时间")] public DateTime LogTime { get; set; } ///