diff --git a/static/css/library.css b/static/css/library.css index 69160c2..208d7b5 100644 --- a/static/css/library.css +++ b/static/css/library.css @@ -102,6 +102,15 @@ cursor: pointer; } +.page-size-select { + padding: 10px 15px; + border: 1px solid #ddd; + border-radius: 6px; + font-size: 14px; + background: white; + cursor: pointer; +} + .toolbar-right { display: flex; gap: 10px; diff --git a/static/js/library.js b/static/js/library.js index 6b68e0f..bf9cbe4 100644 --- a/static/js/library.js +++ b/static/js/library.js @@ -4,7 +4,7 @@ const API_BASE = ''; // 状态 let articles = []; let currentPage = 1; -let pageSize = 100; // 增加每页数量 +let pageSize = 100; let totalCount = 0; let selectedIds = new Set(); let currentArticleId = null; @@ -31,6 +31,13 @@ document.addEventListener('DOMContentLoaded', () => { }); }); +// 改变每页数量 +function changePageSize() { + pageSize = parseInt(document.getElementById('page-size').value); + currentPage = 1; + loadArticles(); +} + // 加载文章列表 async function loadArticles() { const keyword = document.getElementById('search-input').value.trim(); diff --git a/templates/library.html b/templates/library.html index ca497d1..1840015 100644 --- a/templates/library.html +++ b/templates/library.html @@ -35,6 +35,13 @@ +