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

This commit is contained in:
刘祥超
2021-12-08 19:13:34 +08:00
parent 32ba919851
commit 8c95b4a9b9
8 changed files with 75 additions and 19 deletions

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