From 74007a1d451e79987040a7bd49084d64a1e75385 Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Sat, 27 Aug 2022 23:07:48 +0800 Subject: [PATCH] chore: add pagination settings --- internal/bootstrap/data/setting.go | 2 ++ server/common/req.go | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/bootstrap/data/setting.go b/internal/bootstrap/data/setting.go index a020b310..9d9c1997 100644 --- a/internal/bootstrap/data/setting.go +++ b/internal/bootstrap/data/setting.go @@ -72,6 +72,8 @@ func InitialSettings() []model.SettingItem { {Key: conf.BasePath, Value: "", Type: conf.TypeString, Group: model.SITE}, {Key: conf.SiteTitle, Value: "AList", Type: conf.TypeString, Group: model.SITE}, {Key: conf.Announcement, Value: "https://github.com/alist-org/alist", Type: conf.TypeString, Group: model.SITE}, + {Key: "pagination_type", Value: "all", Type: conf.TypeSelect, Options: "all,pagination,load_more,auto_load_more", Group: model.SITE}, + {Key: "default_page_size", Value: "30", Type: conf.TypeNumber, Group: model.SITE}, // style settings {Key: conf.Logo, Value: "https://cdn.jsdelivr.net/gh/alist-org/logo@main/logo.svg", Type: conf.TypeString, Group: model.STYLE}, {Key: conf.Favicon, Value: "https://cdn.jsdelivr.net/gh/alist-org/logo@main/logo.svg", Type: conf.TypeString, Group: model.STYLE}, diff --git a/server/common/req.go b/server/common/req.go index 29c0c983..62476a86 100644 --- a/server/common/req.go +++ b/server/common/req.go @@ -1,8 +1,8 @@ package common type PageReq struct { - Page int `json:"page_index" form:"page"` - PerPage int `json:"page_size" form:"per_page"` + Page int `json:"page" form:"page"` + PerPage int `json:"per_page" form:"per_page"` } const MaxUint = ^uint(0)