From cd5d5149a3c24c7608cdae150f367ee3a8d706c6 Mon Sep 17 00:00:00 2001
From: jaknapper
Date: Mon, 27 Oct 2025 16:40:18 +0000
Subject: [PATCH] Add pagination to scan list
---
.../tabContentComponents/scanListContent.vue | 39 ++++++++++++++++++-
1 file changed, 38 insertions(+), 1 deletion(-)
diff --git a/webapp/src/components/tabContentComponents/scanListContent.vue b/webapp/src/components/tabContentComponents/scanListContent.vue
index c55ca63f..ba8b62df 100644
--- a/webapp/src/components/tabContentComponents/scanListContent.vue
+++ b/webapp/src/components/tabContentComponents/scanListContent.vue
@@ -66,7 +66,7 @@
There are no scans available to show.
-
+
@@ -97,6 +116,8 @@ export default {
ongoing: null,
selectedScan: null,
osdViewer: null,
+ currentPage: 1,
+ itemsPerPage: 18,
};
},
@@ -119,6 +140,13 @@ export default {
return null;
}
},
+ totalPages() {
+ return Math.ceil(this.scans.length / this.itemsPerPage);
+ },
+ paginatedScans() {
+ const start = (this.currentPage - 1) * this.itemsPerPage;
+ return this.scans.slice(start, start + this.itemsPerPage);
+ },
},
async mounted() {
@@ -215,6 +243,11 @@ export default {
this.modalError("Scan not stitched for viewing in webapp, please download or stitch");
}
},
+ changePage(page) {
+ if (page >= 1 && page <= this.totalPages) {
+ this.currentPage = page;
+ }
+ },
},
};
@@ -235,4 +268,8 @@ export default {
margin-top: 5px;
margin-bottom: 2px;
}
+
+.pagination-container {
+ text-align: center;
+}