From 2481d44eb83fc1e163879e19f9c897d20d6b6363 Mon Sep 17 00:00:00 2001 From: "Kim.KANGHEE" Date: Wed, 5 Nov 2025 21:18:29 +0900 Subject: [PATCH] update --- backend/routes/main.py | 7 ++ backend/templates/index.html | 140 +++++++++++++++++++++++------------ 2 files changed, 100 insertions(+), 47 deletions(-) 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 @@
@@ -208,7 +208,7 @@
- +
@@ -218,57 +218,103 @@ - {# 처리된 파일 목록 #} -
-
-
-
-
- - 처리된 파일 목록 -
-
-
- {% if files_to_display and files_to_display|length > 0 %} -
- {% for file_info in files_to_display %} -
-
- - {{ file_info.name or file_info.file }} - -
- +
+ + - - - -
-
+
+
+ {% endfor %} +
+ + + {% if total_pages > 1 %} +
- {% else %} -
- -

표시할 파일이 없습니다.

-
+ + + {% if page < total_pages %} +
  • + + 다음 + +
  • + {% else %} +
  • + 다음 +
  • + {% endif %} + + + {% endif %} -
    + + + {% else %} +
    + +

    표시할 파일이 없습니다.

    +
    + {% endif %}
    + {# 백업된 파일 목록 #}
    @@ -637,4 +683,4 @@ document.addEventListener('DOMContentLoaded', () => { -{% endblock %} \ No newline at end of file +{% endblock %}