diff --git a/backend/routes/main.py b/backend/routes/main.py index 1da422f..4f28d26 100644 --- a/backend/routes/main.py +++ b/backend/routes/main.py @@ -59,8 +59,13 @@ def index(): start = (page - 1) * Config.FILES_PER_PAGE end = start + Config.FILES_PER_PAGE files_to_display = [{"name": Path(f).stem, "file": f} for f in info_files[start:end]] + total_pages = (len(info_files) + Config.FILES_PER_PAGE - 1) // Config.FILES_PER_PAGE + # ✅ 추가: 10개 단위로 표시될 페이지 범위 계산 + start_page = ((page - 1) // 10) * 10 + 1 + end_page = min(start_page + 9, total_pages) + # 백업 폴더 목록 (디렉터리만) backup_dirs = [d for d in backup_dir.iterdir() if d.is_dir()] backup_dirs.sort(key=lambda p: p.stat().st_mtime, reverse=True) @@ -81,6 +86,8 @@ def index(): files_to_display=files_to_display, page=page, total_pages=total_pages, + start_page=start_page, + end_page=end_page, backup_files=backup_files, total_backup_pages=total_backup_pages, backup_page=backup_page, diff --git a/backend/templates/index.html b/backend/templates/index.html index 3965459..4272617 100644 --- a/backend/templates/index.html +++ b/backend/templates/index.html @@ -109,7 +109,7 @@