From 2b7d579dcdb2c8cef96bf783db4b63c054d0390c Mon Sep 17 00:00:00 2001 From: Bhargav Date: Fri, 8 Mar 2024 16:56:47 +0530 Subject: [PATCH] fix: after reset filter records per page not getting reflected (#2912) - After reset filter in full sql mode if limit applied, changing rows per page not getting reflected --- web/src/plugins/logs/Index.vue | 25 +++++++++++++++++++++++++ web/src/plugins/logs/SearchResult.vue | 3 ++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/web/src/plugins/logs/Index.vue b/web/src/plugins/logs/Index.vue index 307001b934..d86e52dfe8 100644 --- a/web/src/plugins/logs/Index.vue +++ b/web/src/plugins/logs/Index.vue @@ -168,6 +168,7 @@ size="md" /> Select a :expandedLogs="expandedLogs" @update:datetime="setHistogramDate" @update:scroll="getMoreData" + @update:recordsPerPage="getMoreDataRecordsPerPage" @expandlog="toggleExpandLog" /> @@ -245,6 +246,30 @@ export default defineComponent({ }); } }, + async getMoreDataRecordsPerPage() { + if (this.searchObj.meta.refreshInterval == 0) { + // this.searchObj.data.resultGrid.currentPage = + // ((this.searchObj.data.queryResults?.hits?.length || 0) + + // ((this.searchObj.data.queryResults?.hits?.length || 0) + 150)) / + // 150 - + // 1; + // this.searchObj.data.resultGrid.currentPage = + // this.searchObj.data.resultGrid.currentPage + 1; + this.searchObj.loading = true; + await this.getQueryData(false); + this.refreshHistogramChart(); + + if (config.isCloud == "true") { + segment.track("Button Click", { + button: "Get More Data", + user_org: this.store.state.selectedOrganization.identifier, + user_id: this.store.state.userInfo.email, + stream_name: this.searchObj.data.stream.selectedStream.value, + page: "Search Logs", + }); + } + } + }, async getMoreData() { if (this.searchObj.meta.refreshInterval == 0) { // this.searchObj.data.resultGrid.currentPage = diff --git a/web/src/plugins/logs/SearchResult.vue b/web/src/plugins/logs/SearchResult.vue index aaa07ffff5..4daf0bbb8d 100644 --- a/web/src/plugins/logs/SearchResult.vue +++ b/web/src/plugins/logs/SearchResult.vue @@ -455,6 +455,7 @@ export default defineComponent({ "remove:searchTerm", "search:timeboxed", "expandlog", + "update:recordsPerPage", ], props: { expandedLogs: { @@ -490,7 +491,7 @@ export default defineComponent({ this.searchObj.data.resultGrid.currentPage = 1; this.pageNumberInput = this.searchObj.data.resultGrid.currentPage; this.refreshPartitionPagination(true); - this.$emit("update:scroll"); + this.$emit("update:recordsPerPage"); this.searchTableRef.scrollTo(0); } else if (actionType == "pageChange") { if (