update
This commit is contained in:
@@ -59,8 +59,13 @@ def index():
|
|||||||
start = (page - 1) * Config.FILES_PER_PAGE
|
start = (page - 1) * Config.FILES_PER_PAGE
|
||||||
end = start + 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]]
|
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
|
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 = [d for d in backup_dir.iterdir() if d.is_dir()]
|
||||||
backup_dirs.sort(key=lambda p: p.stat().st_mtime, reverse=True)
|
backup_dirs.sort(key=lambda p: p.stat().st_mtime, reverse=True)
|
||||||
@@ -81,6 +86,8 @@ def index():
|
|||||||
files_to_display=files_to_display,
|
files_to_display=files_to_display,
|
||||||
page=page,
|
page=page,
|
||||||
total_pages=total_pages,
|
total_pages=total_pages,
|
||||||
|
start_page=start_page,
|
||||||
|
end_page=end_page,
|
||||||
backup_files=backup_files,
|
backup_files=backup_files,
|
||||||
total_backup_pages=total_backup_pages,
|
total_backup_pages=total_backup_pages,
|
||||||
backup_page=backup_page,
|
backup_page=backup_page,
|
||||||
|
|||||||
@@ -109,7 +109,7 @@
|
|||||||
|
|
||||||
<div class="d-flex gap-2">
|
<div class="d-flex gap-2">
|
||||||
<button type="submit" formaction="{{ url_for('utils.update_server_list') }}"
|
<button type="submit" formaction="{{ url_for('utils.update_server_list') }}"
|
||||||
class="btn btn-outline-primary">
|
class="btn btn-secondary">
|
||||||
MAC to Excel
|
MAC to Excel
|
||||||
</button>
|
</button>
|
||||||
<button type="submit" formaction="{{ url_for('utils.update_guid_list') }}"
|
<button type="submit" formaction="{{ url_for('utils.update_guid_list') }}"
|
||||||
@@ -117,7 +117,7 @@
|
|||||||
GUID to Excel
|
GUID to Excel
|
||||||
</button>
|
</button>
|
||||||
<button type="submit" formaction="{{ url_for('utils.update_gpu_list') }}"
|
<button type="submit" formaction="{{ url_for('utils.update_gpu_list') }}"
|
||||||
class="btn btn-success">
|
class="btn btn-warning">
|
||||||
GPU to Excel
|
GPU to Excel
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -208,7 +208,7 @@
|
|||||||
<label class="form-label text-nowrap">GPU 파일 이동</label>
|
<label class="form-label text-nowrap">GPU 파일 이동</label>
|
||||||
<form id="gpuMoveForm" method="post" action="{{ url_for('utils.move_gpu_files') }}">
|
<form id="gpuMoveForm" method="post" action="{{ url_for('utils.move_gpu_files') }}">
|
||||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||||
<button class="btn btn-info w-100" type="submit">GPU Move</button>
|
<button class="btn btn-secondary w-100" type="submit">GPU Move</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -218,11 +218,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{# 처리된 파일 목록 #}
|
{# 처리된 파일 목록 #}
|
||||||
<div class="row mb-4 processed-list">
|
<div class="row mb-4 processed-list">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="card border shadow-sm">
|
<div class="card border shadow-sm">
|
||||||
<div class="card-header bg-light border-0 py-2">
|
<div class="card-header bg-light border-0 py-2 d-flex justify-content-between align-items-center">
|
||||||
<h6 class="mb-0">
|
<h6 class="mb-0">
|
||||||
<i class="bi bi-files me-2"></i>
|
<i class="bi bi-files me-2"></i>
|
||||||
처리된 파일 목록
|
처리된 파일 목록
|
||||||
@@ -239,7 +239,7 @@
|
|||||||
download title="{{ file_info.name or file_info.file }}">
|
download title="{{ file_info.name or file_info.file }}">
|
||||||
{{ file_info.name or file_info.file }}
|
{{ file_info.name or file_info.file }}
|
||||||
</a>
|
</a>
|
||||||
<div class="file-card-buttons">
|
<div class="file-card-buttons d-flex gap-2 justify-content-center">
|
||||||
<button type="button" class="btn btn-sm btn-outline btn-view-processed flex-fill"
|
<button type="button" class="btn btn-sm btn-outline btn-view-processed flex-fill"
|
||||||
data-bs-toggle="modal" data-bs-target="#fileViewModal"
|
data-bs-toggle="modal" data-bs-target="#fileViewModal"
|
||||||
data-folder="idrac_info"
|
data-folder="idrac_info"
|
||||||
@@ -249,7 +249,7 @@
|
|||||||
<form action="{{ url_for('main.delete_file', filename=file_info.file) }}"
|
<form action="{{ url_for('main.delete_file', filename=file_info.file) }}"
|
||||||
method="post" class="d-inline">
|
method="post" class="d-inline">
|
||||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||||
<button type="submit" class="btn btn-sm btn-outline btn-delete-processed"
|
<button type="submit" class="btn btn-sm btn-outline btn-delete-processed flex-fill"
|
||||||
onclick="return confirm('삭제하시겠습니까?');">
|
onclick="return confirm('삭제하시겠습니까?');">
|
||||||
삭제
|
삭제
|
||||||
</button>
|
</button>
|
||||||
@@ -259,6 +259,52 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 페이지네이션 -->
|
||||||
|
{% if total_pages > 1 %}
|
||||||
|
<nav aria-label="Processed files pagination" class="mt-4">
|
||||||
|
<ul class="pagination justify-content-center mb-0">
|
||||||
|
|
||||||
|
<!-- 이전 페이지 -->
|
||||||
|
{% if page > 1 %}
|
||||||
|
<li class="page-item">
|
||||||
|
<a class="page-link" href="{{ url_for('main.index', page=page-1) }}">
|
||||||
|
<i class="bi bi-chevron-left"></i> 이전
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% else %}
|
||||||
|
<li class="page-item disabled">
|
||||||
|
<span class="page-link"><i class="bi bi-chevron-left"></i> 이전</span>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- 페이지 번호 (최대 10개 표시) -->
|
||||||
|
{% set start_page = ((page - 1) // 10) * 10 + 1 %}
|
||||||
|
{% set end_page = [start_page + 9, total_pages]|min %}
|
||||||
|
{% for p in range(start_page, end_page + 1) %}
|
||||||
|
<li class="page-item {% if p == page %}active{% endif %}">
|
||||||
|
<a class="page-link" href="{{ url_for('main.index', page=p) }}">{{ p }}</a>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
<!-- 다음 페이지 -->
|
||||||
|
{% if page < total_pages %}
|
||||||
|
<li class="page-item">
|
||||||
|
<a class="page-link" href="{{ url_for('main.index', page=page+1) }}">
|
||||||
|
다음 <i class="bi bi-chevron-right"></i>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% else %}
|
||||||
|
<li class="page-item disabled">
|
||||||
|
<span class="page-link">다음 <i class="bi bi-chevron-right"></i></span>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
{% endif %}
|
||||||
|
<!-- /페이지네이션 -->
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="text-center py-5">
|
<div class="text-center py-5">
|
||||||
<i class="bi bi-inbox fs-1 text-muted mb-3"></i>
|
<i class="bi bi-inbox fs-1 text-muted mb-3"></i>
|
||||||
@@ -268,7 +314,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{# 백업된 파일 목록 #}
|
{# 백업된 파일 목록 #}
|
||||||
<div class="row backup-list">
|
<div class="row backup-list">
|
||||||
|
|||||||
Reference in New Issue
Block a user