From 64b5d7c7a40b67387156d28931d8af922e7d8bcd Mon Sep 17 00:00:00 2001 From: maciejpedzich Date: Wed, 20 Jul 2022 21:40:54 +0200 Subject: [PATCH] Toggle scroll and pagination depending on mode --- components/snapshot/TrackEntries.vue | 63 ++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 17 deletions(-) diff --git a/components/snapshot/TrackEntries.vue b/components/snapshot/TrackEntries.vue index 9511a96..9ec703d 100644 --- a/components/snapshot/TrackEntries.vue +++ b/components/snapshot/TrackEntries.vue @@ -37,19 +37,34 @@ const formatRetentionText = (retention: number) => { return formattedText; }; + +const datatablePropsToEnable = computed(() => + props.page === 'snapshot' + ? { scrollable: true, scrollHeight: '500px' } + : { + paginator: true, + paginatorTemplate: + 'CurrentPageReport FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown', + currentPageReportTemplate: + 'Showing {first} to {last} of {totalRecords}', + rows: 10, + rowsPerPageOptions: [10, 20, 50, 100] + } +); + +const firstCellMarginTop = computed(() => + props.page === 'stats' ? '3.5rem' : '0' +); + +