add pagination

This commit is contained in:
2026-02-27 16:01:07 +01:00
parent cf264c04fc
commit 1b2f2bb942
3 changed files with 52 additions and 13 deletions

View File

@@ -17,9 +17,10 @@
.status-deleted { background: #ffcccc; text-decoration: line-through; }
.status-no{ background: #ffcccc; }
.status-active { background: #ccffcc; }
button { border: 1px solid #000; background: #eee; padding: 2px 8px; cursor: pointer; font-size: 11px; font-weight: bold; }
button:hover { background: #000; color: #fff; }
button, .button { border: 1px solid #000; background: #eee; padding: 2px 8px; cursor: pointer; font-size: 11px; font-weight: bold; text-decoration: none; }
button:hover, .button:hover { background: #000; color: #fff; }
.nav-link { font-weight: bold; text-decoration: underline; margin-bottom: 20px; display: inline-block; }
.pagination a { margin: 0 2px; }
</style>
</head>
<body>
@@ -27,8 +28,10 @@
<div class="max-w-6xl mx-auto">
<header class="mb-8 border-b-4 border-black pb-2 flex justify-between items-end">
<h1 class="text-3xl font-black uppercase tracking-tighter">System Console</h1>
<a href="/" class="nav-link text-xs">← BACK TO UPLOADER</a>
<a href="/logout" class="nav-link text-xs">LOGOUT</a>
<div>
<a href="/" class="nav-link text-xs">← BACK TO UPLOADER</a>
<a href="/logout" class="nav-link text-xs">LOGOUT</a>
</div>
</header>
<div class="box overflow-x-auto">
@@ -52,14 +55,12 @@
</td>
<td>{{.CreatedAt.Format "Jan 02, 2006 15:04"}}</td>
<td>{{.ExpiresAt.Format "Jan 02, 2006 15:04"}}</td>
<td>{{.DownloadCount}}</td>
<td>
{{.DownloadCount}}
</td>
<td class="">
{{if .DeleteAfterDownload}}
<span class="status-tag status-active">YES</span>
<span class="status-tag status-active">YES</span>
{{else}}
<span class="status-tag status-no">NO</span>
<span class="status-tag status-no">NO</span>
{{end}}
</td>
<td>
@@ -82,8 +83,19 @@
</table>
</div>
<div class="mt-4 flex justify-between items-center">
<div class="space-x-2">
{{if gt .Page 1}}
<a href="?page={{sub .Page 1}}" class="button">← Prev</a>
{{end}}
{{if lt .Page .TotalPages}}
<a href="?page={{add .Page 1}}" class="button">Next →</a>
{{end}}
</div>
</div>
<footer class="mt-4 text-[10px] text-gray-500 uppercase font-bold">
Total Records: {{len .Files}}
Showing {{len .Files}} records — Page {{.Page}} of {{.TotalPages}} — Total Pages: {{.TotalPages}}
</footer>
</div>