diff --git a/webapp/src/components/tabContentComponents/scanListContent.vue b/webapp/src/components/tabContentComponents/scanListContent.vue index c55ca63f..6b4fa48c 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,12 @@ 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) { + this.$emit("scrollTop"); + this.currentPage = page; + } + }, }, }; @@ -235,4 +269,8 @@ export default { margin-top: 5px; margin-bottom: 2px; } + +.pagination-container { + text-align: center; +}