diff options
author | Sukanya Pandey <sukapan1@in.ibm.com> | 2021-08-26 16:04:49 +0300 |
---|---|---|
committer | Derick Montague <derick.montague@ibm.com> | 2021-09-03 01:08:05 +0300 |
commit | f7000cd6cee35434eca4d3eedc5ddb2ae853873e (patch) | |
tree | fa2636e0e23392f7dba2dbc2b4921270665feba5 | |
parent | 932aff93a96fff5fb2d1e1dc264f944cc78b3f83 (diff) | |
download | webui-vue-f7000cd6cee35434eca4d3eedc5ddb2ae853873e.tar.xz |
Resolve bug for pagination not being updated
- Bug: When a user filters a page, the pagination does not change.
- Solution: When a user filters a page, the pagination will be updated based on
the filtered results.
- This patchset will also add pagination in dumps page.
Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com>
Change-Id: I189d27b5489c42ac85f25c0a1a4cdb7cf7eae5c2
-rw-r--r-- | src/views/Logs/Dumps/Dumps.vue | 35 | ||||
-rw-r--r-- | src/views/Logs/EventLogs/EventLogs.vue | 2 | ||||
-rw-r--r-- | src/views/Logs/PostCodeLogs/PostCodeLogs.vue | 2 | ||||
-rw-r--r-- | src/views/SecurityAndAccess/Sessions/Sessions.vue | 2 |
4 files changed, 38 insertions, 3 deletions
diff --git a/src/views/Logs/Dumps/Dumps.vue b/src/views/Logs/Dumps/Dumps.vue index 4538b305..00bbf7f8 100644 --- a/src/views/Logs/Dumps/Dumps.vue +++ b/src/views/Logs/Dumps/Dumps.vue @@ -105,6 +105,32 @@ </page-section> </b-col> </b-row> + <!-- Table pagination --> + <b-row> + <b-col sm="6" xl="5"> + <b-form-group + class="table-pagination-select" + :label="$t('global.table.itemsPerPage')" + label-for="pagination-items-per-page" + > + <b-form-select + id="pagination-items-per-page" + v-model="perPage" + :options="itemsPerPageOptions" + /> + </b-form-group> + </b-col> + <b-col sm="6" xl="5"> + <b-pagination + v-model="currentPage" + first-number + last-number + :per-page="perPage" + :total-rows="getTotalRowCount(filteredItemCount)" + aria-controls="table-dump-entries" + /> + </b-col> + </b-row> </b-container> </template> @@ -127,6 +153,11 @@ import BVTableSelectableMixin, { tableHeaderCheckboxIndeterminate, } from '@/components/Mixins/BVTableSelectableMixin'; import BVToastMixin from '@/components/Mixins/BVToastMixin'; +import BVPaginationMixin, { + currentPage, + perPage, + itemsPerPageOptions, +} from '@/components/Mixins/BVPaginationMixin'; import LoadingBarMixin from '@/components/Mixins/LoadingBarMixin'; import SearchFilterMixin, { searchFilter, @@ -149,6 +180,7 @@ export default { mixins: [ BVTableSelectableMixin, BVToastMixin, + BVPaginationMixin, LoadingBarMixin, SearchFilterMixin, TableFilterMixin, @@ -199,8 +231,11 @@ export default { label: this.$t('global.action.delete'), }, ], + currentPage: currentPage, filterEndDate: null, filterStartDate: null, + itemsPerPageOptions: itemsPerPageOptions, + perPage: perPage, searchFilter, searchFilteredItemsCount: 0, selectedRows, diff --git a/src/views/Logs/EventLogs/EventLogs.vue b/src/views/Logs/EventLogs/EventLogs.vue index fa3f43cb..a841f3ea 100644 --- a/src/views/Logs/EventLogs/EventLogs.vue +++ b/src/views/Logs/EventLogs/EventLogs.vue @@ -230,7 +230,7 @@ first-number last-number :per-page="perPage" - :total-rows="getTotalRowCount(filteredLogs.length)" + :total-rows="getTotalRowCount(filteredRows)" aria-controls="table-event-logs" /> </b-col> diff --git a/src/views/Logs/PostCodeLogs/PostCodeLogs.vue b/src/views/Logs/PostCodeLogs/PostCodeLogs.vue index a6892fb5..87fd9656 100644 --- a/src/views/Logs/PostCodeLogs/PostCodeLogs.vue +++ b/src/views/Logs/PostCodeLogs/PostCodeLogs.vue @@ -138,7 +138,7 @@ first-number last-number :per-page="perPage" - :total-rows="getTotalRowCount(filteredLogs.length)" + :total-rows="getTotalRowCount(filteredRows)" aria-controls="table-post-code-logs" /> </b-col> diff --git a/src/views/SecurityAndAccess/Sessions/Sessions.vue b/src/views/SecurityAndAccess/Sessions/Sessions.vue index bd4c06a9..9782e7f2 100644 --- a/src/views/SecurityAndAccess/Sessions/Sessions.vue +++ b/src/views/SecurityAndAccess/Sessions/Sessions.vue @@ -104,7 +104,7 @@ first-number last-number :per-page="perPage" - :total-rows="getTotalRowCount(allConnections.length)" + :total-rows="getTotalRowCount(filteredRows)" aria-controls="table-session-logs" /> </b-col> |