From 3d1fa6d3263d3284171c01ee3ec2c031e8133992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Jerman?= Date: Tue, 13 Jun 2023 13:16:06 +0200 Subject: [PATCH] Don't request total count for automation sessions The front-end was already ignoring that value and counting those poses a big hit to server responsiveness. --- client/web/admin/src/mixins/listHelpers.js | 5 +++-- client/web/admin/src/views/Automation/Session/List.vue | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/client/web/admin/src/mixins/listHelpers.js b/client/web/admin/src/mixins/listHelpers.js index cd449a775..375e3fbee 100644 --- a/client/web/admin/src/mixins/listHelpers.js +++ b/client/web/admin/src/mixins/listHelpers.js @@ -16,6 +16,7 @@ export default { nextPage: '', total: 0, page: 1, + incTotal: true, }, // Used to save query when fetching for total if we came to the page with a pageCursor in URL @@ -124,7 +125,7 @@ export default { encodeListParams () { const { sortBy, sortDesc } = this.sorting - const { limit, pageCursor } = this.pagination + const { limit, pageCursor, incTotal } = this.pagination const sort = sortBy ? `${sortBy} ${sortDesc ? 'DESC' : 'ASC'}` : undefined @@ -133,7 +134,7 @@ export default { sort: pageCursor ? undefined : sort, ...this.filter, pageCursor, - incTotal: !pageCursor || this.tempQuery, + incTotal: incTotal && (!pageCursor || this.tempQuery), } }, diff --git a/client/web/admin/src/views/Automation/Session/List.vue b/client/web/admin/src/views/Automation/Session/List.vue index ffd186daf..1a390b761 100644 --- a/client/web/admin/src/views/Automation/Session/List.vue +++ b/client/web/admin/src/views/Automation/Session/List.vue @@ -155,6 +155,16 @@ export default { sortDesc: true, }, + pagination: { + limit: 100, + pageCursor: undefined, + prevPage: '', + nextPage: '', + total: 0, + page: 1, + incTotal: false, + }, + fields: [ { key: 'sessionID',