多处访问日志增加单页显示条数选择

This commit is contained in:
GoEdgeLab
2021-12-08 19:13:34 +08:00
parent b338926d9d
commit 4448a0438d
8 changed files with 75 additions and 19 deletions

View File

@@ -29,6 +29,8 @@ func (this *IndexAction) RunGet(params struct {
RequestId string
ServerId int64
PageSize int64
}) {
if len(params.Day) == 0 {
params.Day = timeutil.Format("Y-m-d")
@@ -43,13 +45,17 @@ func (this *IndexAction) RunGet(params struct {
this.Data["accessLogs"] = []interface{}{}
this.Data["hasError"] = params.HasError
this.Data["hasWAF"] = params.HasWAF
this.Data["pageSize"] = params.PageSize
day := params.Day
ipList := []string{}
if len(day) > 0 && regexp.MustCompile(`\d{4}-\d{2}-\d{2}`).MatchString(day) {
day = strings.ReplaceAll(day, "-", "")
size := int64(20)
size := params.PageSize
if size < 1 {
size = 20
}
this.Data["hasError"] = params.HasError

View File

@@ -28,6 +28,8 @@ func (this *HistoryAction) RunGet(params struct {
RequestId string
HasError int
PageSize int
}) {
if len(params.Day) == 0 {
params.Day = timeutil.Format("Y-m-d")
@@ -41,13 +43,17 @@ func (this *HistoryAction) RunGet(params struct {
this.Data["accessLogs"] = []interface{}{}
this.Data["hasError"] = params.HasError
this.Data["hasWAF"] = params.HasWAF
this.Data["pageSize"] = params.PageSize
day := params.Day
ipList := []string{}
if len(day) > 0 && regexp.MustCompile(`\d{4}-\d{2}-\d{2}`).MatchString(day) {
day = strings.ReplaceAll(day, "-", "")
size := int64(20)
size := int64(params.PageSize)
if size < 1 {
size = 20
}
this.Data["hasError"] = params.HasError

View File

@@ -24,8 +24,15 @@ func (this *TodayAction) RunGet(params struct {
Keyword string
Ip string
Domain string
PageSize int
}) {
size := int64(20)
this.Data["pageSize"] = params.PageSize
size := int64(params.PageSize)
if size < 1 {
size = 20
}
this.Data["path"] = this.Request.URL.Path
this.Data["hasError"] = params.HasError